Monthly Archives: July 2018

Solution-wide Nuget package version handling with MsBuild 15+

Last year I blogged about a way to handle NuGet package versions at the solution level for .NET SDK-based csproj project files (so those using <PackageReference /> entries to define their NuGet dependencies).

That approach worked reasonably well, but was entirely custom – as it simply relied on defining reusable MsBuild properties to handled the versions, which created a bit of overhead.

With MsBuild 15 and newer, you can actually do it in a much more elegant way. Let’s have a look.

Continue Reading

Overriding externally set headers and HTTP status codes in ASP.NET Core

I was working on an interesting issue in an ASP.NET Core recently. An external framework was responsible for creating an HTTP Response, and I was only in control of a little component that customized some internal behaviours (via a relevant extensibility point), without being able to influence the final response sent over HTTP.

This is common if you think about extending things like CMS systems or specialized services like for example Identity Server. In those situations, more often than not, the framework would be highly opinionated in what it is trying to do at the HTTP boundaries and as a result, trying to override the HTTP status codes or headers it produces may not be easy.

Let’s have a look at a simple generic workaround.

Continue Reading