-
Notifications
You must be signed in to change notification settings - Fork 1.1k
MSB4018 on Blazor WASM with .NET 9.0.300 #49039
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Under similar circumstances, I am encountering similar errors across all my ASP.NET Core Razor Class Libraries that include MVC |
Cc @javiercn |
@MRT-77 can you provide a binlog/repro so that we can take a look? |
I just created a new Blazor Web App in Visual Studio with default settings and ran it, but the error occurred! |
R: @javiercn |
I think this might be related to blazor/razor component error, but only on non-windows |
rolling back to 9.0.204 using global.json allows it to compile. also with plain asp.net core web site, not only with blazor. Happens to me in Windows. |
I was curious so I tested it on Ubuntu 24.04 LTS WSL2 and the build was completed without errors. install instruction:
dotnet build output:
|
same issue with dotnet build and just one custom css in new asp.net core web app (razor pages):
|
@javiercn Running dotnet clean or using Visual Studio's Clean Solution does not remove the StaticAsset cache file (rpswa.dswa.cache.json) located in the obj directory. Workaround: Especially, when you checkout to another branch and you had different web assets, then you must delete "obj" folder once again. Otherwise, you will face "xxx.js" is not defined ... etc. Hopefully, it would be patched in future I also created an issue about it : |
Describe the bug
After upgrading Visual Studio to version 17.14.0, I started encountering this issue.
To resolve it, I first performed a Repair using the Visual Studio Installer, but the problem persisted.
For further troubleshooting, I completely uninstalled Visual Studio and installed only the .NET SDK manually.
Then, I installed the required workloads using the CLI. However, even after creating a clean Blazor WebAssembly project and building it, the same error still occurred.
However, I was able to temporarily work around the problem by manually installing .NET SDK 9.0.204 after reinstalling Visual Studio, and then deleting the folder
C:\Program Files\dotnet\sdk\9.0.300
.This resolved the build error both in Visual Studio and when using the CLI.
To Reproduce
dotnet workload install wasm-tools
dotnet new blazorwasm -o _MyCleanApp --framework net9.0
Exceptions
Further technical details
The text was updated successfully, but these errors were encountered: