-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Failure to publish WASM when project source path contains blank spaces - Post-upgrade VS 2022 to 17.2.4 #26061
Comments
Same issue Windows 11 Pro 21H2 Visual Studio Enterprise 2022 64-bit version 17.2.3 dotnet --list-sdks |
Thanks a lot for the report @NonoSparc! However, that seems to be a Visual Studio bug, which should be reported to VS Dev Community, see https://developercommunity.visualstudio.com/report?space=8&entry=problem. Could you please open the issue there? |
It also happens in DevOps pipeline. I have the same using UseDotNet@2 task. I had to force it to use 6.0.106 to fix a broken build pipeline
|
Can you reproduce it locally from CLI @jocecaro ? |
How did you force please ? |
Ok. I confirm that Steps:
You can add
see https://docs.microsoft.com/en-us/dotnet/core/tools/global-json |
cc @dsplaisted Should this be moved to runtime repo or somewhere else? |
C:\temp\tmp with spaces\blazortest>dotnet publish Determining projects to restore... |
@cook32 to force it in DevOps. Added this to the top of tasks in my YAML
|
That works ! Added global.json with version 6.0.203 in the solution folder, deleted all /bin and /obj folders in solution projects => I can now publish successfully ! |
Same problem since upgrade of Visual Studio 2022 from 17.2.3 to 17.2.4 yesterday. Lots of wasted hours trying to publish a Blazor app to Azure. Tried global.json in the solution folder but caused .NET5 projects to fail to load. Eventually fixed by removing 6.0.301 from "C:\Program Files\dotnet\sdk" and copying in 6.0.202 from a backup. EDIT: Also works with 6.0.300 which I downloaded from the 6.0.5 section here: https://dotnet.microsoft.com/en-us/download/dotnet/6.0 |
Same problem here since upgrade of Visual Studio 2022 from 17.2.3 to 17.2.4 yesterday. Removing White space in file path fixed it. |
We're having the same problem in Azure DevOps Pipelines since yesterday, using v6.0.301 of the SDK. The We don't have any whitespace in our project's path name, but in Azure DevOps Pipelines the
which does suggest it's the space in |
This was helpful I kept getting error "Microsoft.NET.Sdk.Blazor WebAssembly.6_0.targets(614,5): error MSB6006". I can confirm once I removed spaces (my directory to mydirectory) on the build environment, the blazor build was successful. |
Hey folks, can anyone impacted please upload a binlog with details? This really help us speed up the process of identifying where the issue with space handling is being introduced, so we can route it to the correct team for triage and resolution. |
Here you will find binlog generated with a test project which failed to publish. Hope it will help. |
@baronfel here's one from a minimal reproducible example I set up. My issue is very slightly different - the whitespace is not in the project path but in the path to dotnet.exe. I assume it's related though. I also discovered that the issue only occurs when my Blazor WASM app's |
Thanks folks - we believe this was inadvertently introduced with an update to System.CommandLine that changed the default processing of response files. The binlog above was very helpful in tracking this down @craigbrown, so thank you for that! Heres what's been generated in the current bad state, I'm talking with the System.CommandLine team and figuring out how we want to resolve this. Will report back with options and how we intend to go forward. Part of my personal confusion here is that this generated response file has something that I'd expect to be incorrect: the very first line seems to use space-delimited tokens (which must be quoted correctly and the path to dotnet isn't), and all the other lines are line-delimited (which can be logically quoted as 'complete' single tokens and so seem fine to me). EDIT: this isn't the actual response file, it's the final command line as given to msbuild, post response file processing. This explains the ambiguity of the first line. I've updated it to be correct. The overall response file is still not great because of the spaces in the paths, but we can work with that. |
Definitely the problem is with Task BrotliCompress; I created two test projects, one with not spaces and one with spaces. Here is the binlog file of the one with spaces: BlazorAppWithSpaces_Release_AnyCPU_Build_2022-06-17T20_23_21.3052265-04_00.zip |
Done, thanks for the reminder! |
@baronfel - Based on the previous comments, this doesn't look like an issue in the websdk targets. What would be the best label for this? |
global.json file wont work if its inside the path/folder which has space issue so keep it in top most possible folder. |
The solution is to copy the folder and rename it. Just for the sake of publishing. |
Confirming that setting /p:BlazorEnableCompression=false fixes the issue during build. So its a problem during the compression stage. On a side note: using /p:SelfContained=false overrides the BlazorEnableCompression setting. |
+1 same problem really a big bad waste of time... nasty problem! Fixed mine by downgrading from 301 to 300 SDK... 301 has security patch so that is not a long term solution MS need to fix that at the next release. For people in my situation here what i have done. Instruction above wasn't clear especially for people who are not used to play with dotnet sdks... i think most of us rely on VS IDE to install/update .netx.x and move on to develop... i didn't have sdk 300 installed...
|
We're sorry about this regression, and yes, we do expect to fix this in the next release (302). Here's the relevant PR: #26204 |
Unfortunately there wasn't time to get this fix into the next build (302 / July), so it should be in the 303 / August release. |
Today I installed Visual Studio update 17.2.6 which deleted the DotNet SDK version 6.0.300. I removed my global.json with 6.0.300 and tested with 302 but as mentioned before, the error is still there: I tried to install 6.0.300 again and I got the following error: Should I remove the 6.0.302 SDK to reinstall 6.0.300 or is another workaround? |
@SantosVictorero you'll have to install 6.0.300 manually and then use a global.json file to 'pin' to that version specifically in order to workaround this bug. Echoing @dsplaisted above, 6.0.303 in August will contain the fix for this and at that point you could remove your global.json. |
Thanks @baronfel, it works like a charm, again! 👍 Download and manually install .NET: |
I'm going to close this one in favor of #26026, which it is a duplicate of. |
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. |
I've reopened the original issue due to this. |
Is there a workaround that we can use in the meantime? The latest version of VS removed 6.0.300 and I cannot manually install it due to having a newer version installed. I tried updating the global.json file to use 6.0.303 but that did not work. Any suggestions would be appreciated. |
The only workaround is working in a path that doesn't contain spaces, unfortunately. |
Probably you can use version 6.0.203 as a work around too: https://dotnet.microsoft.com/en-us/download/dotnet/thank-you/sdk-6.0.203-windows-x64-installer. |
I was able to implement the workaround @SantosVictorero suggested, but wondering when this will be fixed? |
Sorry my english. The problem is with the Maximum Path Length Limitation. To solve this problem You just need change the project path to a small path like C:\MyProject, and that it :-) I hope this help to every one... |
...
... |
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. |
Since 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:
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
The text was updated successfully, but these errors were encountered: