mRizvandi
mRizvandi

Reputation: 1093

Publish Blazor WebAssembly With VS2022 Ver 17.2.5 Error

Visual Studio 2022, Version 17.2.5 released with support of dot NET Ver 6.0.301.

In this version, if you publish the blazor webassembly project, you got error:

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.

This error is a bug on dot NET 6.0.301 and you have to downgrade the system or change project to use dot NET version to 6.0.300.

Upvotes: 0

Views: 147

Answers (1)

mRizvandi
mRizvandi

Reputation: 1093

  1. First of all, Open Microsoft dot NET download page:

    https://dotnet.microsoft.com/en-us/download/dotnet/thank-you/sdk-6.0.300-windows-x64-installer

  2. Download and Install the earlier version (6.0.300).

  3. Add global.json file to solution in file explorer. (close to X.sln file)

  4. Well, at the end, you have to paste this content to global.json file:

{
  "sdk": {
    "version": "6.0.300"
  }
}
  1. Publish the project again.

Upvotes: 1

Related Questions