Setting RuntimeFrameworkVersion of Blazor project and building with .net 9 SDK installed fails to create blazor.boot.json file #59069
Labels
area-infrastructure
Includes: MSBuild projects/targets, build scripts, CI, Installers and shared framework
Is there an existing issue for this?
Describe the bug
Hey, so have been on a bit of discovery with this. I recently installed the latest VS update, coincidentally getting the .net 9 SDK.
WE have a Blazor wasm standalone application, using .net 8. Due to a seperate issue related to our build pipeline, we added the following line to our .csproj a couple months ago:
<RuntimeFrameworkVersion>8.0.7</RuntimeFrameworkVersion>
(The issue was with 8.0.10).It appears that this one line is the root cause of all our issues.
Anyway, when I first attempted to build the project after having updated VS / got the .net 9 SDK, I could no longer build the project. The error I receive was:
Upon searching, I found very little. I mainly found mentioned of the same "task failed", but being triggered instead by a duplicate key issue, not the Endpoints not found issue. Its also not an issue with the nuget package it references - that just happens to be the first nuget package in the .csproj file - Coincidentally we aren't using that one currently so I had tried removing it, in which case we get the same error but pointing to the next nuget package which is installed instead.
Amongst other things, I tried a clean and rebuild. This also failed, but now the error was different:
I checked, and there was in fact no blazor.boot.json file being created there.
So the endpoints issue, I believe is due to the blazor.boot.json file not being created, but the file was already there so a stale, out of date file was being used instead. So the real bug, is that under this scenario the blazor.boot.json file isn't being created for some reason.
In order to fix this, our initial fix has been to create a
global.json
file at the repo root as:I am however going to be checking soon to see if we can use 8.0.11 as our previous build issue was with 8.0.10 and we haven't tried 8.0.11 yet, as Removing the
<RuntimeFrameworkVersion>8.0.7</RuntimeFrameworkVersion>
line from the .csproj also fixed the issue entirely.Expected Behavior
Should be able to build - Should create the blazor.boot.json file
Steps To Reproduce
<RuntimeFrameworkVersion>8.0.7</RuntimeFrameworkVersion>
For the sake of completeness, a fresh .net 8 Blazor wasm standalone app, where the csproj file is the following:
Exceptions (if any)
.NET Version
9.0.100
Anything else?
dotnet --info
The text was updated successfully, but these errors were encountered: