Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extension fails with error: "Cannot locate MSBuild engine for .NET SDK v9.0.100." #149

Closed
djohnst10 opened this issue May 24, 2024 · 3 comments · Fixed by #152
Closed

Extension fails with error: "Cannot locate MSBuild engine for .NET SDK v9.0.100." #149

djohnst10 opened this issue May 24, 2024 · 3 comments · Fixed by #152

Comments

@djohnst10
Copy link

With the .NET 9 SDK Preview 4 installed I get these errors in VS Code when opening a folder containing a .NET solution.

System.Exception: Cannot locate MSBuild engine for .NET SDK v9.0.100. This probably means that MSBuild Project Tools cannot find the MSBuild for the current project instance. It did find the following version(s), though: [8.0.300].
   at MSBuildProjectTools.LanguageServer.Utilities.MSBuildHelper.DiscoverMSBuildEngine(String baseDirectory, ILogger logger)
   at MSBuildProjectTools.LanguageServer.Program.Main()
[Error - 10:41:51 AM] Connection to server got closed. Server will not be restarted.
[Error - 10:41:51 AM] MSBuild Language Service client: couldn't create connection to server.
  Message: Pending response rejected since connection got disposed
  Code: -32097 
[Error - 10:41:51 AM] Server process exited with code 1.

The .NET solution I usually work on has a mix of .NET Standard projects and older .NET Framework projects, but I've got these errors with folders containing only .NET SDK-style projects.

Here are the .NET SDKs installed:
8.0.300 [C:\Program Files\dotnet\sdk]
9.0.100-preview.4.24267.66 [C:\Program Files\dotnet\sdk]

@tintoy
Copy link
Owner

tintoy commented May 26, 2024

Hi - sorry to hear you're having problems; are you able to post the full output from running dotnet --info in the solution directory?

@tintoy
Copy link
Owner

tintoy commented May 26, 2024

I'm pretty sure this is related to #144; the mechanism we use to locate the appropriate MSBuild version for the current runtime (MSBuildLocator) has not, historically, supported preview versions of .NET and simply ignored them). It does support preview versions now, but we have to opt into supporting them and we haven't decided (yet) how best to do that.

@DoctorKrolic - can I get a second opinion / sanity check? 🙂

@djohnst10
Copy link
Author

Here is the log.

I looked at #144. This does look like the same issue.

.NET SDK:
 Version:           9.0.100-preview.4.24267.66
 Commit:            26d3d259e4
 Workload version:  9.0.100-manifests.9dc03b27
 MSBuild version:   17.11.0-preview-24225-01+bd0b1e466

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.22631
 OS Platform: Windows
 RID:         win-x64
 Base Path:   C:\Program Files\dotnet\sdk\9.0.100-preview.4.24267.66\

.NET workloads installed:
 [maui-windows]
   Installation Source: VS 17.10.34916.146, VS 17.11.34909.67
   Manifest Version:    9.0.0-preview.1.9973/9.0.100-preview.1
   Manifest Path:       C:\Program Files\dotnet\sdk-manifests\9.0.100-preview.1\microsoft.net.sdk.maui\9.0.0-preview.1.9973\WorkloadManifest.json
   Install Type:              Msi

 [maccatalyst]
   Installation Source: VS 17.10.34916.146, VS 17.11.34909.67
   Manifest Version:    17.2.9088-net9-p1/9.0.100-preview.1
   Manifest Path:       C:\Program Files\dotnet\sdk-manifests\9.0.100-preview.1\microsoft.net.sdk.maccatalyst\17.2.9088-net9-p1\WorkloadManifest.json
   Install Type:              Msi

 [ios]
   Installation Source: VS 17.10.34916.146, VS 17.11.34909.67
   Manifest Version:    17.2.9088-net9-p1/9.0.100-preview.1
   Manifest Path:       C:\Program Files\dotnet\sdk-manifests\9.0.100-preview.1\microsoft.net.sdk.ios\17.2.9088-net9-p1\WorkloadManifest.json
   Install Type:              Msi

 [android]
   Installation Source: VS 17.10.34916.146, VS 17.11.34909.67
   Manifest Version:    34.99.0-preview.1.151/9.0.100-preview.1
   Manifest Path:       C:\Program Files\dotnet\sdk-manifests\9.0.100-preview.1\microsoft.net.sdk.android\34.99.0-preview.1.151\WorkloadManifest.json
   Install Type:              Msi

 [aspire]
   Installation Source: VS 17.10.34916.146, VS 17.11.34909.67
   Manifest Version:    9.0.0-preview.2.24163.9/9.0.100-preview.1
   Manifest Path:       C:\Program Files\dotnet\sdk-manifests\9.0.100-preview.1\microsoft.net.sdk.aspire\9.0.0-preview.2.24163.9\WorkloadManifest.json
   Install Type:              Msi


Host:
  Version:      9.0.0-preview.4.24266.19
  Architecture: x64
  Commit:       d0d6fed6c0

.NET SDKs installed:
  8.0.300 [C:\Program Files\dotnet\sdk]
  9.0.100-preview.4.24267.66 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 6.0.30 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 8.0.5 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 9.0.0-preview.4.24267.6 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 6.0.30 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 8.0.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 9.0.0-preview.4.24266.19 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.WindowsDesktop.App 6.0.30 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 8.0.5 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 9.0.0-preview.4.24267.11 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

Other architectures found:
  x86   [C:\Program Files (x86)\dotnet]
    registered at [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\x86\InstallLocation]

Environment variables:
  Not set

global.json file:
  Not found

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

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants