A custom HttpContent (see StreamExposerContent implementation) with a smart trick to export Stream: Externalizing the HttpClient internals for fun & profit – Ayende @ Rahien
With this single line in change log:
Change – Removed .NET 4 portable class library target from NuGet package
Json.Net has also removed the Silverlight 5 support.
A middleware to provide specific html pages for some error and default one for others while returning correct http error code as status: Re-execute the middleware pipeline with the StatusCodePages Middleware to create custom error pages.
We can also want to know the original path that actually caused the error: pretty easy using Request Features in ASP.NET Core and querying for IStatusCodeReExecuteFeature. In fact, current implementation of this interface also provides error query string (but it will not be reflected into interface before .Net 2.0): Retrieving the path that generated an error with the StatusCodePages Middleware
All is already said in title: Using strongly typed configuration in .NET Core console app.
Main interest of this post is to reaffirm that strongly typed configuration is not restricted to Asp.Net core. After all, an Asp.Net core are only command line programs making some http listening.
New to Creator’s Update, we can now specify a static function in charge of creation instance from string through a very well named attribute CreateFromString.
ReadLine is a GNU Readline like library built in pure C#. It can serve as a drop in replacement for the inbuilt
Console.ReadLine()and brings along with it some of the terminal goodness you get from unix shells, like command history navigation and tab auto completion.
An AutoCompletionHandler callback can be used to provide an array of suggestion.
Apparently, my customers do not have the WPF black screen bug (Video Rendering Issues for WPF Windows – Rick Strahl’s Web Log) but the solution is elegant enough to be noted.
With some video card/drivers, WPF’s main window (and more particularilly MahApps main window) can be completly black. This seems to be an hardware rendering problem. Good news, a per processs solution exist:
that can be set at startup to SoftwareOnly. Good to know!
Use of COM based
to host .Net Core from native C++ code How the dotnet CLI tooling runs your code · Performance is a Feature!.
Topic already covered in Hosting .NET Core CLR in Windows native process.
“Disecting the new() constraint” is very instructive: new() constraint has a big performance impact and we must know its implementation to understand why ctor exceptions are wrapped to a TargetInvocationException.
By the way, in same blog post, I’ve discovered that some well known static functions can be custom replaceable. It means you can locally redefined them. System.Activator.CreateInstance<T> is replaced by a faster one.
Beware, this is a completly not documented behavior than can be theoretically remove any time. Just to mitigate previous remark, this undocumented behavior is so important survived the Roslyn transition.