dotnet / dotnet/sdk

# NETSDK1139: browser platform identifier not recognized with .NET 10 WASM

Open
#54,879 1 comment 1 reaction 0 assignees View on GitHub
untriaged
Dominant language
C#
Stars
3.2k
Forks
1.3k
PR merge metrics
PR metrics pending

Description

### Describe the bug

## Problem

When building a `net10.0-browser` WASM project with SDK 10.0.301 and `wasm-tools` installed, the build fails:

```
error NETSDK1139: The target platform identifier browser was not recognized.
```

Diagnosing with `-v:diag` reveals the real error:

```
error MSB4019: The imported project "...\Microsoft.NET.SDK.WorkloadAutoImportPropsLocator\Sdk\AutoImport.props" was not found.
```

The `Sdk` folder inside `Microsoft.NET.SDK.WorkloadAutoImportPropsLocator` is completely empty, `AutoImport.props` was never generated.

## Root Cause

When `wasm-tools` is installed via **both** Visual Studio and the .NET SDK CLI, the installation source is listed as:

```
wasm-tools 10.0.109/10.0.100 SDK 10.0.300, VS 18.7.x
```

The dual VS + SDK installation must corrupt the workload, preventing `AutoImport.props` from being generated. Running `dotnet workload repair` does not fix it.

Similar issue: https://github.com/dotnet/sdk/issues/41862

## Solution

1. Uninstall `wasm-tools` via the CLI: `dotnet workload uninstall wasm-tools`
2. Uninstall all .NET Runtimes and `.NET 10.0 WebAssembly Build Tools` via Visual Studio Installer
3. Uninstall all .NET SDKs via `Apps & Features` on Windows, and delete the leftover folders in `C:\Program Files\dotnet`
4. Reinstall the .NET 10 SDK using the standalone installer from microsoft.com (not via Visual Studio)
5. Install `wasm-tools` via CLI only: `dotnet workload install wasm-tools`

After reinstalling, also disable the broken VS NuGet source left behind:

```
dotnet nuget disable source "Microsoft Visual Studio Offline Packages"
```

Verify the workload source is now SDK-only:

```
dotnet workload list
# wasm-tools 10.0.109/10.0.100 SDK 10.0.300
```

After this, `dotnet build` works.

### Steps to reproduce

I believe this issue occurs when installing `wasm-tools` via both:
- command line with `dotnet workload install wasm-tools`
- `Visual Studio Installer > Visual Studio 2026 > Modify > Individual Components > .NET 10.0 WebAssembly Build Tools`

### Expected behavior

`.net10.0-browser` projects should build when `wasm-tools` are installed.

### Actual behavior

These errors occur when running `dotnet build`:

```
error NETSDK1139: The target platform identifier browser was not recognized.
```

Diagnosing with `-v:diag` reveals the real error:

```
error MSB4019: The imported project "...\Microsoft.NET.SDK.WorkloadAutoImportPropsLocator\Sdk\AutoImport.props" was not found.
```

### Is this a regression?

Unsure - I've only tested WASM with .NET 10

### Are there any workarounds?

Could not find a workaround, only solution to uninstall and install all .NET runtimes/workloads/tools.

### dotnet --info output

```console
.NET SDK:
Version: 10.0.301
Commit: 96856fd726
Workload version: 10.0.301.1
MSBuild version: 18.6.4+96856fd72

Runtime Environment:
OS Name: Windows
OS Version: 10.0.19045
OS Platform: Windows
RID: win-x64
Base Path: C:\Program Files\dotnet\sdk\10.0.301\

.NET workloads installed:
[wasm-tools]
Installation Source: SDK 10.0.300
Manifest Version: 10.0.109/10.0.100
Manifest Path: C:\Program Files\dotnet\sdk-manifests\10.0.100\microsoft.net.workload.mono.toolchain.current\10.0.109\WorkloadManifest.json
Install Type: Msi

Configured to use workload sets when installing new manifests.

Host:
Version: 10.0.9
Architecture: x64
Commit: 901ca94124

.NET SDKs installed:
10.0.301 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
Microsoft.AspNetCore.App 10.0.9 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 10.0.9 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 10.0.9 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

Other architectures found:
None

Environment variables:
None

global.json file:
Not found

Learn more:
https://aka.ms/dotnet/info

Download .NET:
https://aka.ms/dotnet/download
```

### IDE version

Visual Studio 2026

### Other details

_No response_

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the `net10.0-browser` build with SDK 10.0.301 and `wasm-tools`, then run `dotnet build -v:diag` and inspect the missing `Microsoft.NET.SDK.WorkloadAutoImportPropsLocator\Sdk\AutoImport.props`. Done means the dual Visual Studio and CLI workload installation no longer leaves `AutoImport.props` missing and the project builds successfully.

Written by the indexing model from the issue text.

Assessment

Tech stack
wasm
Domain
build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.