0

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.

1 Answer 1

1
  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.
Sign up to request clarification or add additional context in comments.

1 Comment

This worked for me, as getting desperate. Make sure you add the global.json file to the root directory of the solution.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.