nathanAjacobs
NamedPipeClientStream.ReadAsync() continuously reads after the first message arrives
How come
NamedPipeClientStream.ReadAsync
continuously reads 0 bytes after the first message arrives?
Basically is there a way to have it asynchronously wait until more data arrives after the first message?5 replies
What exactly do these limitations mean for NativeAOT?
- No C++/CLI.
- Windows: No built-in COM
From the docs:
https://learn.microsoft.com/en-us/dotnet/core/deploying/native-aot/?tabs=net8plus%2Cwindows#limitations-of-native-aot-deployment
24 replies
Optional parameters with dependency injection
Is it possible to have an optional parameter for a constructor with dependency injection. I know that dependency injection usually it implies it is a required dependency, but for example if the only dependency is an
ILogger
, then I don't really care if one was registered or not.
EDIT: Changed ILogger<Test>
to be nullable
10 replies
❔ Are there read only collections that don't box enumerators?
ReadOnlyCollection<T>
boxes struct enumerators since it stores IList<T>
internally.
ImmutableList<T>
does not box enumerator, but I actually want to publically expose a List as read only and privately be able to modify it.11 replies
✅ Would a ConcurrentDictionary be necessary if I am only adding and never removing?
Would a ConcurrentDictionary be necessary if I'm only ever adding keys and never removing them? Also I'm not using the values of the dictionary so if ConcurrentDictionary is not needed I could use a regular HashSet instead.
12 replies
❔ WindowsAppSDK (WinUI 3) shutdown app before window is shown?
In WindowsAppSDK (WinUI 3) is it possible to shutdown the application specifically in the
OnLaunched
override before the main window is shown? Application.Exit()
does not work until the main window is shown.2 replies
❔ Did Visual Studio change how async exceptions break?
If I am remembering correctly, Visual Studio used to break on the await of the Task when an exception occurred in the Task. However Visual Studio is now breaking inside the Task method. Has this behavior changed?
3 replies
❔ Is it possible to have WPF window hidden until Blazor WebView loads page?
I'm trying to hide a WPF window until the Blazor WebView loads, but it seems that the initialization of the webview does not happen until the window is actually shown. Is there a way to do this?
2 replies
Processing incoming networking messages
Say I have a processing loop which processes incoming network messages asynchronously with ConfigureAwait(false). Should I synchronize back to the SynchronizationContext (if there is one) to invoke the callback delegates that are subscribed to the message type?
12 replies