Home > other >  Can not publish Blazor wasm to azure anymore
Can not publish Blazor wasm to azure anymore

Time:06-17

i just wanted to publish my changes to my .Net6 blazor wasm app to azure to update it like i did a dozen times. Since yesterday that does not work anymore. I can build and run it locally with no problem but when I try to publish it, I get a window telling me:

Publish has encountered an error. Build failed. Check the Output window for more details.

A diagnostic log has been written to the following location: "C:\Users\user\AppData\Local\Temp\tmpE865.tmp"

Content of that file:

16.06.2022 08:20:08 System.AggregateException: One or more errors occurred. ---> Microsoft.WebTools.Shared.Exceptions.WebToolsException: Build failed. Check the Output window for more details. --- End of inner exception stack trace --- ---> (Inner Exception #0) Microsoft.WebTools.Shared.Exceptions.WebToolsException: Build failed. Check the Output window for more details.<---

Microsoft.WebTools.Shared.Exceptions.WebToolsException: Build failed. Check the Output window for more details.

===================

Console Output:

C:\Program Files\dotnet\sdk\6.0.400-preview.22301.10\Sdks\Microsoft.NET.Sdk.BlazorWebAssembly\targets\Microsoft.NET.Sdk.BlazorWebAssembly.6_0.targets(614,5): Error MSB6006: "dotnet.exe" exited with code 1.

Tried fetching older versions of the code that I successfully published a few days ago. Still does not work. My coworker can still publish the same code.

But I can publish my API Backend...so this error seems to be related to blazor wasm.

Tried this with the latest release of VS 2022 and just gave the preview version a try - no luck.

I've also done a repair installation of the .Net 6 SDK.

Edit: I've tried to publish my project to a folder and got the same error. So no relation to azure. Then I've created a new blank Blazor app...I can publish this one to a folder with no error. So my project is somehow broken...but even older code can't be published. This is so odd...

CodePudding user response:

@XSharp is correct. We had same issue started occurring yesterday. We were using version '6.0.x' of DotNet which seems to have started using version '6.0.301' that seems to be causing this issue. Force it to use the previous version '6.0.106' instead

Just add the following at the top of your tasks in your YAML

- task: UseDotNet@2
  inputs:
     packageType: 'sdk'
     version: '6.0.106'

Looks like someone has reported it as an issue when having a blank space in your project path: https://github.com/dotnet/core/issues/7548

CodePudding user response:

In my case, changing the SDK in the YAML of the pipeline fixed the issue for us.

In UseDotNet@2 task:

Changed : version: '6.0.x' To : version: '6.0.106'

It was working before so it seems like something has changed in the hosts.

  • Related