dotnet / sdk

Core functionality needed to create .NET Core projects, that is shared between Visual Studio and CLI
https://dot.net/core
MIT License
2.7k stars 1.06k forks source link

Can not publish hosted Blazor Webassembly application. Space in path bug. #27404

Closed McVanS closed 2 years ago

McVanS commented 2 years ago

The space and/or special character in path bug is back!

Did the update 17.3.2 and I was holding thumbs the bug was fixed but alas not.

Microsoft Visual Studio Community 2022 Version 17.3.2 VisualStudio.17.Release/17.3.2+32819.101 Microsoft .NET Framework Version 4.8.04084

While publishing a Blazor hosted Webassembly application I receive the following error in the output window: C:\Program Files\dotnet\sdk\6.0.400\Sdks\Microsoft.NET.Sdk.BlazorWebAssembly\targets\Microsoft.NET.Sdk.BlazorWebAssembly.6_0.targets(614,5): Error MSB6006: "dotnet.exe" exited with code 1.

The log file does not state any detail about the error. In fact it refers you back to the output window.

I had my suspicions as I had this problem before so I copied the project to a folder to C:\Temp\Project, build and the published the project with no errors or problems. On a side note, having spaces in the "publish to" folder/path does not cause any errors. It seems it is the location of the project that causes the error if there are spaces anywhere in the path. This has been a problem before.

Thank you.

baronfel commented 2 years ago

Hello, thanks for submitting. This is a duplicate of https://github.com/dotnet/sdk/issues/26026 - I fixed the .NET CLI itself, but not the blazor tool invoked by a target. PR to fix it is https://github.com/dotnet/sdk/pull/27213.

McVanS commented 2 years ago

Thanks.