As .NET developer I am pretty excited about Blazor and I am already using it in one of out prototypes.
However as many other alpha / preview libraries and frameworks it suffers from tiny yet annoying little bugs.
One of these bugs on Blazor its inability to switch from
Release configuration seamlessly as other .NET project types do.
So after compiling the solution / project in
Debug and then deploying it in
Release mode you might see the following screen:
As you can see it’s a known issue, currently present in all versions of Blazor, including the latest preview version (0.8.0-preview-*) available at the time of writing this article.
Obviously you could manually remove
Release folder depending on your current configuration or write a small tools which does the same thing for you.
However you could automate the removal of the opposite / redundant folder by using good ol’ MSBuild target. Just drop the following Directory.Build.targets file into your Blazor app’s solution root folder and you will never to take care about this error again.
Alternatively you might also integrate entire
<Target> element inside your Blazor standalone .csproj file
Subscribe via RSS