Closed Lukespacewalker closed 2 years ago
Facing a similar issue with a blazorwasm
project template.
No configuration changes in the project file.
Just ran the following commands on Windows 11 machine after creating a project from the template, supplied OOB.
dotnet new blazorwasm --output MyBlazorApp
cd MyBlazorApp
dotnet run -c Release
The project ran successfully, but when published resulted in the below error.
dotnet publish -c Release
C:\Program Files\dotnet\sdk\7.0.100-rc.1.22431.12\Sdks\Microsoft.NET.Sdk.BlazorWebAssembly\targets\Microsoft.NET.Sdk.BlazorWebAssemb ly.6_0.targets(614,5): error MSB6006: "C:\Program Files\dotnet" exited with code 1. [E:\NET 7\RC1\MyBlazorApp\MyBlazorApp.csproj]
Are there spaces in the full path names for your projects, @Lukespacewalker and @egvijayanand? If so, could you try a project location that does not include spaces and let us know if it fixes your issue?
@MackinnonBuck There is no space in my solution and project paths (C:\Users\Sutti\source\repos\OccMedCheckUpBlazor\OccMedCheckUpBlazor.sln
,C:\Users\Sutti\source\repos\OccMedCheckUpBlazor\OccMedCheckUpBlazor\Client\OccMedCheckUpBlazor.Client.csproj
, C:\Users\Sutti\source\repos\OccMedCheckUpBlazor\OccMedCheckUpBlazor\Server\OccMedCheckUpBlazor.Server.csproj
)
But there is a space in dotnet component which are installed to Program Files
folder such as C:\Program Files\dotnet\packs\Microsoft.NETCore.App.Runtime.Mono.browser-wasm\7.0.0-rc.1.22426.10\runtimes\browser-wasm\lib\net7.0
. From the logs I've posted above this seems to be a problem.
If I publish in Linux OS instead (.net sdk docker, to be precise), the app can be published successfully.
Thanks for the response, @Lukespacewalker.
I'm not able to reproduce the issue on my end. Does the problem occur when publishing both from Visual Studio and from the command line (i.e. dotnet publish
)?
@MackinnonBuck It occurs on both Visual Studio and dotnet publish
. This issue only occurs when I try to publish (add <PublishTrimmed>false</PublishTrimmed>
in Blazor WASM csproj) using Windows. If I publish using Linux (Ubuntu), the publishing process is successful. Also, if I remove <PublishTrimmed>false</PublishTrimmed>
, which will enable Trimming, the publish process will also successful.
Are there spaces in the full path names for your projects, @Lukespacewalker and @egvijayanand? If so, could you try a project location that does not include spaces and let us know if it fixes your issue?
Yes indeed, whitespace is present in the path leading to the project artifacts. After removing the whitespace, the project is getting published. Hopefully, a fix will be made available for this issue before the GA release.
@egvijayanand It looks like the issue you're experiencing was fixed by https://github.com/dotnet/sdk/pull/27213 and will be available in the RC2 release.
@Lukespacewalker Thanks for the additional info. Unfortunately, the issue is still not reproducing on my end - would you be able to share a minimal repro project that demonstrates the issue, hosted as a public GitHub repository?
It looks like the issue you're experiencing was fixed by dotnet/sdk#27213 and will be available in the RC2 release.
Thanks for letting us know that it is getting fixed.
@Lukespacewalker are you still experiencing this issue? If so, would you please be able to provide a repro project for us, hosted as a public GitHub repository?
Hi @Lukespacewalker. We have added the "Needs: Author Feedback" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.
@MackinnonBuck Here a minimal repo https://github.com/Lukespacewalker/BlankBlazorWASM. But I think this problem occurs only in Windows because .NET SDK is installed in Program Files
folder, containing space in path, that break BrotliCompression tool.
By the way, is your .NET sdk on testing computer also installed in the folder containing space like me?
dotnet --list-sdks
7.0.100-rc.1.22431.12 [C:\Program Files\dotnet\sdk]
@Lukespacewalker Thanks for providing a repro project! I've tried to reproduce the issue you're facing on both my local machine and a fresh VM, neither of which have had any problems publishing the repro project. In both cases, the .NET SDK is installed in Program Files
.
But given that https://github.com/dotnet/sdk/pull/27213 fixed a similar issue with the BrotliCompress tool, I would say it's likely that your issue will be resolved as well starting in RC2.
Could you try installing the latest 7.0 SDK daily build from https://github.com/dotnet/installer (from the Release/7.0.1xx column in the README) and see if using that SDK version fixes the problem? That would confirm whether any further action needs to be taken here.
Hi @Lukespacewalker. We have added the "Needs: Author Feedback" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.
@MackinnonBuck Sorry for late reply. I've install 7.0 SDK daily build and it fixs the problem
@Lukespacewalker Fantastic, thanks for trying that out! Closing this out now.
Is there an existing issue for this?
Describe the bug
Try publish the Blazor WASM with publish PublishTrimmed false in Windows, the process will fail with this error (But if I publish using Linux, the publish process will success.)
I try to turn on Verbosity to debug. It look like the whitespace in path problem is come back
Expected Behavior
The app should publish successfully.
Steps To Reproduce
<PublishTrimmed>false</PublishTrimmed>
.csproj of Blazor WASMExceptions (if any)
No response
.NET Version
7.0.100-rc.1.22431.12
Anything else?
OS: Windows 11 Insider Preview 25201
.NET SDK: Version: 7.0.100-rc.1.22431.12 Commit: f1cf61e1c0
Runtime Environment: OS Name: Windows OS Version: 10.0.25201 OS Platform: Windows RID: win10-x64 Base Path: C:\Program Files\dotnet\sdk\7.0.100-rc.1.22431.12\
Host: Version: 7.0.0-rc.1.22426.10 Architecture: x64 Commit: 06aceb7015
.NET SDKs installed: 6.0.400 [C:\Program Files\dotnet\sdk] 7.0.100-preview.7.22377.5 [C:\Program Files\dotnet\sdk] 7.0.100-rc.1.22431.12 [C:\Program Files\dotnet\sdk]
.NET runtimes installed: Microsoft.AspNetCore.App 6.0.8 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 7.0.0-preview.7.22376.6 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 7.0.0-rc.1.22427.2 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.NETCore.App 3.1.23 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 6.0.8 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 7.0.0-preview.7.22375.6 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 7.0.0-rc.1.22426.10 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.WindowsDesktop.App 3.1.23 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 6.0.8 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 7.0.0-preview.7.22377.1 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 7.0.0-rc.1.22427.1 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Other architectures found: x86 [C:\Program Files (x86)\dotnet]
Environment variables: Not set
global.json file: Not found
Learn more: https://aka.ms/dotnet/info
Download .NET: https://aka.ms/dotnet/download