Failure to publish WASM when project source path contains blank spaces - Post-upgrade VS 2022 to 17.2.4
See original GitHub issueSince upgrade of Visual Studio 2022 from 17.2.3 to 17.2.4 on june 15th, I cannot publish any Blazor Web Application project anymore.
This goes for new and existing projects. Even a simple publish to folder fails with error message:
C:\Program Files\dotnet\sdk\6.0.301\Sdks\Microsoft.NET.Sdk.BlazorWebAssembly\targets\Microsoft.NET.Sdk.BlazorWebAssembly.6_0.targets(614,5): Error MSB6006: "dotnet.exe" exited with code 1.
After hours of frustating attempts, I found that it was related to the location of my projects. Parent path to my dev folder contained blank spaces!
Changing VS MSBuild output verbosity, I found that the error was related to Blazor WebAssembly publish artifacts compression task:
...
Compressing Blazor WebAssembly publish artifacts. This may take a while...
Creating directory "obj\Release\net6.0\compress\".
C:\Program Files\dotnet\dotnet.exe "C:\Program Files\dotnet\sdk\6.0.301\Sdks\Microsoft.NET.Sdk.BlazorWebAssembly\targets\..\tools\net6.0\Microsoft.NET.Sdk.BlazorWebAssembly.Tool.dll" brotli
-s
C:\Dev\With Space\BlazorAppSol\BlazorApp\Client\bin\Release\net6.0\wwwroot\_framework\blazor.webassembly.js
-o
C:\Dev\With Space\BlazorAppSol\BlazorApp\Client\obj\Release\net6.0\compress\N6++qccl.br
...
Unrecognized command or argument 'Space\BlazorAppSol\BlazorApp\Client\bin\Release\net6.0\wwwroot\_framework\blazor.webassembly.js'.
...
C:\Program Files\dotnet\sdk\6.0.301\Sdks\Microsoft.NET.Sdk.BlazorWebAssembly\targets\Microsoft.NET.Sdk.BlazorWebAssembly.6_0.targets(614,5): Error MSB6006: "dotnet.exe" exited with code 1.
The above output was produced by creating a new Blazor Web Assembly project under a root folder with path 'C:\Dev\With Space' and publishing it to relative folder 'bin\Release\net6.0\publish'.
Is this a known issue?
Configuration: Windows 10 Enterprise 21H2 Build 19044.1766 Visual Studio Enterprise 2022 64-bit version 17.2.4 Blazor WebAssembly App project with .NET 6 and ASP.NET Core host
Issue Analytics
- State:
- Created a year ago
- Reactions:14
- Comments:41 (16 by maintainers)
Top GitHub Comments
A status update on this - we have an approved fix for servicing that we will merge one the September releases go out, so the final fix for this will be in the October releases of the .NET SDK.
I’ve updated my VS2022 Preview yesterday, and my (production) VS 2022 is failing to publish with this same error on SDK 6.0.400.
The global.json file forcing the 6.0.300 version solved the problem also.
I’m just taking a note for the possibility of the bug is back on the 6.0.400.