I have a .NET 8 Blazor project that has been working in .NET 8.0.100 but broke with the recent Visual Studio update that includes the new .NET 8.0.201 release.
This release is breaking the build. I am able to get around this by adding a global.json file to the root of my solution to explicitly use the .NET 8.0.100 SDK.
{
"sdk": {
"version": "8.0.100"
}
}
This is the error thrown by the use of the new .NET SDK
The analyzer assembly 'C:\Program Files\dotnet\sdk\8.0.201\Sdks\Microsoft.NET.Sdk.Razor\source-generators\Microsoft.CodeAnalysis.Razor.Compiler.SourceGenerators.dll' references version '4.9.0.0' of the compiler, which is newer than the currently running version '4.8.0.0'.
The issue on the NCrunch side is that NCrunch is apparently ignoring the global.json file and thus failing to build the projects when running tests.
Yes, it took some time finding it, I must have scrolled past it a dozen times but changing the Build Sdk setting to 8.0.100 for each project fixed the NCrunch builds.
erikgassler wrote:Yes, it took some time finding it, I must have scrolled past it a dozen times but changing the Build Sdk setting to 8.0.100 for each project fixed the NCrunch builds.
This is a very new setting, and I guess we got it in there just in time :)
The search box in the top corner of the config window is useful for finding settings like this one. We have so many now that it's a bit of a maze :(