dotnet / dotnet/sdk

`dotnet workload restore` runs into "Unhandled exception: The imported project..."

Open
#49,742 3 comments 0 reactions 1 assignee Claimed by @marcpopMSFT View on GitHub
Area-Workloads
Dominant language
C#
Stars
3.2k
Forks
1.3k
PR merge metrics
PR metrics pending

Description

### Describe the bug

> ➜ dotnet workload restore
>
> Updated advertising manifest microsoft.net.workloads.
> Installing workload version 10.0.100-preview.5.25306.3.
> Downloading microsoft.net.workloads.10.0.100-preview.5.msi.x64 (10.100.0-preview.5.25306.3)
> Installing microsoft.net.workloads.10.0.100-preview.5.msi.x64 .... Done
> Downloading microsoft.net.workload.emscripten.current.manifest-10.0.100-preview.5.msi.x64 (10.0.100-preview.5.25277.114)
> Downloading microsoft.net.workload.emscripten.net6.manifest-10.0.100-preview.5.msi.x64 (10.0.100-preview.5.25277.114)
> Downloading microsoft.net.workload.emscripten.net7.manifest-10.0.100-preview.5.msi.x64 (10.0.100-preview.5.25277.114)
> Downloading microsoft.net.workload.emscripten.net8.manifest-10.0.100-preview.5.msi.x64 (10.0.100-preview.5.25277.114)
> Downloading microsoft.net.workload.emscripten.net9.manifest-10.0.100-preview.5.msi.x64 (10.0.100-preview.5.25277.114)
> Downloading microsoft.net.sdk.android.manifest-10.0.100-preview.5.msi.x64 (36.0.0-preview.5.116)
> Installing microsoft.net.sdk.android.manifest-10.0.100-preview.5.msi.x64 .... Done
> Downloading microsoft.net.sdk.ios.manifest-10.0.100-preview.5.msi.x64 (18.4.10622-net10-p5)
> Installing microsoft.net.sdk.ios.manifest-10.0.100-preview.5.msi.x64 .... Done
> Downloading microsoft.net.sdk.maccatalyst.manifest-10.0.100-preview.5.msi.x64 (18.4.10622-net10-p5)
> Installing microsoft.net.sdk.maccatalyst.manifest-10.0.100-preview.5.msi.x64 .... Done
> Downloading microsoft.net.sdk.macos.manifest-10.0.100-preview.5.msi.x64 (15.4.10622-net10-p5)
> Installing microsoft.net.sdk.macos.manifest-10.0.100-preview.5.msi.x64 .... Done
> Downloading microsoft.net.sdk.maui.manifest-10.0.100-preview.5.msi.x64 (10.0.0-preview.5.25306.5)
> Installing microsoft.net.sdk.maui.manifest-10.0.100-preview.5.msi.x64 .... Done
> Downloading microsoft.net.sdk.tvos.manifest-10.0.100-preview.5.msi.x64 (18.4.10622-net10-p5)
> Installing microsoft.net.sdk.tvos.manifest-10.0.100-preview.5.msi.x64 .... Done
> Downloading microsoft.net.workload.mono.toolchain.current.manifest-10.0.100-preview.5.msi.x64 (10.0.100-preview.5.25277.114)
> Downloading microsoft.net.workload.mono.toolchain.net6.manifest-10.0.100-preview.5.msi.x64 (10.0.100-preview.5.25277.114)
> Downloading microsoft.net.workload.mono.toolchain.net7.manifest-10.0.100-preview.5.msi.x64 (10.0.100-preview.5.25277.114)
> Downloading microsoft.net.workload.mono.toolchain.net8.manifest-10.0.100-preview.5.msi.x64 (10.0.100-preview.5.25277.114)
> Downloading microsoft.net.workload.mono.toolchain.net9.manifest-10.0.100-preview.5.msi.x64 (10.0.100-preview.5.25277.114)
> Downloading microsoft.net.sdk.aspire.manifest-8.0.100.msi.x64 (8.2.2)
> No workloads installed for this feature band. To update workloads installed with earlier SDK versions, include the --from-previous-sdk option.
>
> Successfully updated workload(s): .
>
> Unhandled exception: The imported project "C:\Program Files\dotnet\sdk\10.0.100-preview.5.25277.114\Microsoft\DesktopBridge\Microsoft.DesktopBridge.props" was not found. Confirm that the expression in the Import declaration "$(WapProjPath)\Microsoft.DesktopBridge.props", which evaluated to "C:\Program Files\dotnet\sdk\10.0.100-preview.5.25277.114\Microsoft\DesktopBridge\\Microsoft.DesktopBridge.props", is correct, and that the file exists on disk. C:\repos\NuGetPackageExplorer\NuGetPackageExplorer\PackageExplorer.Package\PackageExplorer.Package.wapproj

The file `C:\repos\NuGetPackageExplorer\NuGetPackageExplorer\PackageExplorer.Package\PackageExplorer.Package.wapproj` exists. MAX_PATH issue?!
`C:\Program Files\dotnet\sdk\10.0.100-preview.5.25277.114\Microsoft\DesktopBridge\Microsoft.DesktopBridge.props` does not exist, my Microsoft folder (`C:\Program Files\dotnet\sdk\10.0.100-preview.5.25277.114\Microsoft\`) only contains `Microsoft.NET.Build.Extensions`

### To Reproduce

git clone https://github.com/NuGetPackageExplorer/NuGetPackageExplorer.git

> ➜ dotnet build
> C:\Program Files\dotnet\sdk\10.0.100-preview.5.25277.114\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.ImportWorkloads.targets(38,5): error NETSDK1147:
> To build this project, the following workloads must be installed: wasm-tools-net9
> To install these workloads, run the following command: dotnet workload restore
> C:\repos\NuGetPackageExplorer\NuGetPackageExplorer\PackageExplorer.Package\PackageExplorer.Package.wapproj : warning NU1503: Skipping restore for project 'C:\repos\NuGetPackageExplorer\NuGetPackageExplorer\PackageExplorer.Package\PackageExplorer.Package.wapproj'. The project file may be invalid or missing targets required for restore.
>
> Restore failed with 1 error(s) and 1 warning(s) in 3,3s

dotnet workload restore

### Exceptions (if any)

> Unhandled exception: The imported project "C:\Program Files\dotnet\sdk\10.0.100-preview.5.25277.114\Microsoft\DesktopBridge\Microsoft.DesktopBridge.props" was not found. Confirm that the expression in the Import declaration "$(WapProjPath)\Microsoft.DesktopBridge.props", which evaluated to "C:\Program Files\dotnet\sdk\10.0.100-preview.5.25277.114\Microsoft\DesktopBridge\\Microsoft.DesktopBridge.props", is correct, and that the file exists on disk. C:\repos\NuGetPackageExplorer\NuGetPackageExplorer\PackageExplorer.Package\PackageExplorer.Package.wapproj

### Further technical details
- Include the output of `dotnet --info`

.NET SDK:
Version: 10.0.100-preview.5.25277.114
Commit: ddf39a1b46
Workload version: 10.0.100-preview.5.25306.3
MSBuild version: 17.15.0-preview-25277-114+ddf39a1b4

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.100-preview.5.25277.114\

.NET workloads installed:
There are no installed workloads to display.
Configured to use workload sets when installing new manifests.

Host:
Version: 10.0.0-preview.5.25277.114
Architecture: x64
Commit: ddf39a1b46

.NET SDKs installed:
8.0.412 [C:\Program Files\dotnet\sdk]
9.0.302 [C:\Program Files\dotnet\sdk]
10.0.100-preview.5.25277.114 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
Microsoft.AspNetCore.App 8.0.18 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 9.0.7 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 10.0.0-preview.5.25277.114 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 8.0.18 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 9.0.7 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 10.0.0-preview.5.25277.114 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 8.0.18 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 9.0.7 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 10.0.0-preview.5.25277.114 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

Other architectures found:
None

Environment variables:
Not set

global.json file:
C:\repos\NuGetPackageExplorer\NuGetPackageExplorer\global.json

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

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

- The IDE (VS / VS Code/ VS4Mac) you're running on, and its version
N/A

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.