Error publishing Blazor Webassembly with AOT (.Net 8.0) - Error : Precompiling failed for ProjectTest\obj\Release\net8.0\wasm\for-publish\aot-in\aot-instances.dll. C:\Program Files\dotnet\packs\Microsoft.NET.Runtime.WebAssembly.Sdk\8.0.0\Sdk\WasmApp.Native.targets(686,5): error : Can not open image ProjectTest\ProjectTest.csproj
It worked with .net 7.0. It fails with .net 8.0.
I ran dotnet workload install wasm-tools, since I got that error first with .net 8.0. Then removed the bin and obj files for the entire solution.
I updated packages from nuget. I updated all the package references to 8.0.0 where applicable in my project file.
Check that you don't have a space in the path to your project file. It seems there is currently a bug in the AOT compilation:
https://github.com/dotnet/runtime/issues/101055
It should be fixed in the next release (8.0.6)
[Edit] As per the comment below, it is now supposed to be fixed in 8.0.7