question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Omnisharp won't load a template .NET 6 project

See original GitHub issue

Issue Description

On Windows, I installed the .NET 6 SDK. I already have previous SDK versions installed and VS 2019 installed, but not VS 2022. After installing the .NET 6 SDK, I installed the C# extension into VS Code. I’ve restarted VS Code, restarted the PC. It won’t load the webapi template project properly. Omnisharp insists on using VS 2019’s MSBuild. Tried installing VS 2022 build tools and overriding Omnisharp to use that MSBuild, but still can’t get it to work.

Steps to Reproduce

I dotnet new webapi and opened the new project directory in VS Code. Omnisharp fails to load the project. Potential problems seem to be that it’s trying to build against SDK 5.0.100 rather than 6.0.11 and it’s selecting VS 2019’s MSBuild 16.8.1 (SDK 6’s minimumMSBuildVersion says 6.10.0).

Here's the Onmisharp log:
OmniSharp server started.
    Path: c:\Users\myuser\.vscode\extensions\ms-dotnettools.csharp-1.23.17\.omnisharp\1.37.17\OmniSharp.exe
    PID: 17832

[dbug]: OmniSharp.CompositionHostBuilder
        Loaded OmniSharp.Cake, Version=1.37.0.0, Culture=neutral, PublicKeyToken=7e5bf7b3b470b509
[dbug]: OmniSharp.CompositionHostBuilder
        Loaded OmniSharp.DotNetTest, Version=1.37.0.0, Culture=neutral, PublicKeyToken=7e5bf7b3b470b509
[dbug]: OmniSharp.CompositionHostBuilder
        Loaded OmniSharp.Host, Version=1.37.0.0, Culture=neutral, PublicKeyToken=7e5bf7b3b470b509
[dbug]: OmniSharp.CompositionHostBuilder
        Loaded OmniSharp.MSBuild, Version=1.37.0.0, Culture=neutral, PublicKeyToken=7e5bf7b3b470b509
[dbug]: OmniSharp.CompositionHostBuilder
        Loaded OmniSharp.Roslyn, Version=1.37.0.0, Culture=neutral, PublicKeyToken=7e5bf7b3b470b509
[dbug]: OmniSharp.CompositionHostBuilder
        Loaded OmniSharp.Roslyn.CSharp, Version=1.37.0.0, Culture=neutral, PublicKeyToken=7e5bf7b3b470b509
[dbug]: OmniSharp.CompositionHostBuilder
        Loaded OmniSharp.Script, Version=1.37.0.0, Culture=neutral, PublicKeyToken=7e5bf7b3b470b509
[dbug]: OmniSharp.CompositionHostBuilder
        Loaded OmniSharp.Shared, Version=1.37.0.0, Culture=neutral, PublicKeyToken=7e5bf7b3b470b509
[info]: OmniSharp.Stdio.Host
        Starting OmniSharp on Windows 6.2.9200.0 (x64)
[info]: OmniSharp.Services.DotNetCliService
        Checking the 'DOTNET_ROOT' environment variable to find a .NET SDK
[info]: OmniSharp.Services.DotNetCliService
        Using the 'dotnet' on the PATH.
[info]: OmniSharp.Services.DotNetCliService
        DotNetPath set to dotnet
[dbug]: OmniSharp.CompositionHostBuilder
        .NET SDK requires MSBuild instances version 16.3 or higher
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        Located 4 MSBuild instance(s)
            1: Visual Studio Build Tools 2017 15.9.28307.1146 15.9.21 - "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin"
            2: Visual Studio Community 2017 15.9.28307.665 15.9.21 - "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin"
            3: Visual Studio Community 2019 16.8.30711.63 16.8.1 - "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin"
            4: StandAlone 17.0.0 - "c:\Users\myuser\.vscode\extensions\ms-dotnettools.csharp-1.23.17\.omnisharp\1.37.17\.msbuild\Current\Bin"
[dbug]: OmniSharp.CompositionHostBuilder
        MSBuild instance Visual Studio Build Tools 2017 15.9.28307.1146 15.9.21 scored at -2147483648
[dbug]: OmniSharp.CompositionHostBuilder
        MSBuild instance Visual Studio Community 2017 15.9.28307.665 15.9.21 scored at -2147483648
[dbug]: OmniSharp.CompositionHostBuilder
        MSBuild instance Visual Studio Community 2019 16.8.30711.63 16.8.1 scored at 2
[dbug]: OmniSharp.CompositionHostBuilder
        MSBuild instance StandAlone 17.0.0 scored at 1
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        Registered MSBuild instance: Visual Studio Community 2019 16.8.30711.63 16.8.1 - "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin"
[dbug]: OmniSharp.WorkspaceInitializer
        Starting with OmniSharp options: {"RoslynExtensionsOptions":{"EnableDecompilationSupport":false,"EnableAnalyzersSupport":false,"EnableImportCompletion":false,"EnableAsyncCompletion":false,"DocumentAnalysisTimeoutMs":10000,"LocationPaths":null},"FormattingOptions":{"OrganizeImports":false,"EnableEditorConfigSupport":true,"NewLine":"\n","UseTabs":false,"TabSize":4,"IndentationSize":4,"SpacingAfterMethodDeclarationName":false,"SpaceWithinMethodDeclarationParenthesis":false,"SpaceBetweenEmptyMethodDeclarationParentheses":false,"SpaceAfterMethodCallName":false,"SpaceWithinMethodCallParentheses":false,"SpaceBetweenEmptyMethodCallParentheses":false,"SpaceAfterControlFlowStatementKeyword":true,"SpaceWithinExpressionParentheses":false,"SpaceWithinCastParentheses":false,"SpaceWithinOtherParentheses":false,"SpaceAfterCast":false,"SpacesIgnoreAroundVariableDeclaration":false,"SpaceBeforeOpenSquareBracket":false,"SpaceBetweenEmptySquareBrackets":false,"SpaceWithinSquareBrackets":false,"SpaceAfterColonInBaseTypeDeclaration":true,"SpaceAfterComma":true,"SpaceAfterDot":false,"SpaceAfterSemicolonsInForStatement":true,"SpaceBeforeColonInBaseTypeDeclaration":true,"SpaceBeforeComma":false,"SpaceBeforeDot":false,"SpaceBeforeSemicolonsInForStatement":false,"SpacingAroundBinaryOperator":"single","IndentBraces":false,"IndentBlock":true,"IndentSwitchSection":true,"IndentSwitchCaseSection":true,"IndentSwitchCaseSectionWhenBlock":true,"LabelPositioning":"oneLess","WrappingPreserveSingleLine":true,"WrappingKeepStatementsOnSingleLine":true,"NewLinesForBracesInTypes":true,"NewLinesForBracesInMethods":true,"NewLinesForBracesInProperties":true,"NewLinesForBracesInAccessors":true,"NewLinesForBracesInAnonymousMethods":true,"NewLinesForBracesInControlBlocks":true,"NewLinesForBracesInAnonymousTypes":true,"NewLinesForBracesInObjectCollectionArrayInitializers":true,"NewLinesForBracesInLambdaExpressionBody":true,"NewLineForElse":true,"NewLineForCatch":true,"NewLineForFinally":true,"NewLineForMembersInObjectInit":true,"NewLineForMembersInAnonymousTypes":true,"NewLineForClausesInQuery":true},"FileOptions":{"SystemExcludeSearchPatterns":["**/node_modules/**/*","**/bin/**/*","**/obj/**/*","**/.git/**/*","**/.git","**/.svn","**/.hg","**/CVS","**/.DS_Store","**/Thumbs.db","**/*.js"],"ExcludeSearchPatterns":[]},"RenameOptions":{"RenameOverloads":false,"RenameInStrings":false,"RenameInComments":false},"ImplementTypeOptions":{"InsertionBehavior":null,"PropertyGenerationBehavior":null},"DotNetCliOptions":{"LocationPaths":null},"Plugins":{"LocationPaths":null}}
[info]: OmniSharp.WorkspaceInitializer
        Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.CSharpFormattingWorkspaceOptionsProvider, Order: 0
[info]: OmniSharp.WorkspaceInitializer
        Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.Completion.CompletionOptionsProvider, Order: 0
[info]: OmniSharp.WorkspaceInitializer
        Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.RenameWorkspaceOptionsProvider, Order: 100
[info]: OmniSharp.WorkspaceInitializer
        Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.ImplementTypeWorkspaceOptionsProvider, Order: 110
[info]: OmniSharp.WorkspaceInitializer
        Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.BlockStructureWorkspaceOptionsProvider, Order: 140
[info]: OmniSharp.Cake.CakeProjectSystem
        Detecting Cake files in 'c:\Users\myuser\OneDrive\Documents\Programming\net6api'.
[info]: OmniSharp.Cake.CakeProjectSystem
        Could not find any Cake files
[dbug]: OmniSharp.MSBuild.ProjectSystem
        MSBuild environment: 
Mode: VisualStudio
RunningTests: False
RunningInVisualStudio: False
MSBuildToolsDirectory32: C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin
MSBuildToolsDirectory64: C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\amd64
MSBuildSDKsPath: C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Sdks
CurrentMSBuildConfigurationFile: C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\MSBuild.exe.config
CurrentMSBuildExePath: C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\MSBuild.exe
CurrentMSBuildToolsDirectory: C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin
VisualStudioInstallRootDirectory: C:\Program Files (x86)\Microsoft Visual Studio\2019\Community
MSBuildExtensionsPath: C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild

[info]: OmniSharp.MSBuild.ProjectSystem
        No solution files found in 'c:\Users\myuser\OneDrive\Documents\Programming\net6api'
[info]: OmniSharp.MSBuild.ProjectManager
        Queue project update for 'c:\Users\myuser\OneDrive\Documents\Programming\net6api\net6api.csproj'
[info]: OmniSharp.Script.ScriptProjectSystem
        Detecting CSX files in 'c:\Users\myuser\OneDrive\Documents\Programming\net6api'.
[info]: OmniSharp.Script.ScriptProjectSystem
        Could not find any CSX files
[info]: OmniSharp.WorkspaceInitializer
        Configuration finished.
[info]: OmniSharp.Stdio.Host
        Omnisharp server running using Stdio at location 'c:\Users\myuser\OneDrive\Documents\Programming\net6api' on host 18952.
[dbug]: OmniSharp.Stdio.Host
        ************ Request ************
{
  "Type": "request",
  "Seq": 14,
  "Command": "/projects"
}
[dbug]: OmniSharp.Stdio.Host
        ************ Request ************
{
  "Type": "request",
  "Seq": 15,
  "Command": "/projects"
}
[info]: OmniSharp.MSBuild.ProjectManager
        Loading project: c:\Users\myuser\OneDrive\Documents\Programming\net6api\net6api.csproj
[fail]: OmniSharp.MSBuild.ProjectLoader
        The current .NET SDK does not support targeting .NET Core 6.0.  Either target .NET Core 5.0 or lower, or use a version of the .NET SDK that supports .NET Core 6.0.
[warn]: OmniSharp.MSBuild.ProjectManager
        Failed to load project file 'c:\Users\myuser\OneDrive\Documents\Programming\net6api\net6api.csproj'.
c:\Users\myuser\OneDrive\Documents\Programming\net6api\net6api.csproj
C:\Program Files\dotnet\sdk\5.0.100\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.TargetFrameworkInference.targets(141,5): Error: The current .NET SDK does not support targeting .NET Core 6.0.  Either target .NET Core 5.0 or lower, or use a version of the .NET SDK that supports .NET Core 6.0.

[fail]: OmniSharp.MSBuild.ProjectManager
        Attempted to update project that is not loaded: c:\Users\myuser\OneDrive\Documents\Programming\net6api\net6api.csproj
[dbug]: OmniSharp.Stdio.Host
        ************  Response (1416.2187ms) ************ 
{
  "Request_seq": 15,
  "Command": "/projects",
  "Running": true,
  "Success": true,
  "Message": null,
  "Body": {
    "MsBuild": {
      "SolutionPath": "c:\\Users\\myuser\\OneDrive\\Documents\\Programming\\net6api",
      "Projects": []
    },
    "Script": {
      "Projects": []
    }
  },
  "Seq": 39,
  "Type": "response"
}
[dbug]: OmniSharp.Stdio.Host
        ************  Response (1416.8851ms) ************ 
{
  "Request_seq": 14,
  "Command": "/projects",
  "Running": true,
  "Success": true,
  "Message": null,
  "Body": {
    "MsBuild": {
      "SolutionPath": "c:\\Users\\myuser\\OneDrive\\Documents\\Programming\\net6api",
      "Projects": []
    },
    "Script": {
      "Projects": []
    }
  },
  "Seq": 37,
  "Type": "response"
}
[dbug]: OmniSharp.Stdio.Host
        ************ Request ************
{
  "Type": "request",
  "Seq": 16,
  "Command": "/projects"
}
[dbug]: OmniSharp.Stdio.Host
        ************  Response (0.2281ms) ************ 
{
  "Request_seq": 16,
  "Command": "/projects",
  "Running": true,
  "Success": true,
  "Message": null,
  "Body": {
    "MsBuild": {
      "SolutionPath": "c:\\Users\\myuser\\OneDrive\\Documents\\Programming\\net6api",
      "Projects": []
    },
    "Script": {
      "Projects": []
    }
  },
  "Seq": 48,
  "Type": "response"
}

Then, tried adding a global.json into the project:

{
    "sdk": {
        "version": "6.0.100"
    }
}

Omnisharp then fails with this instead

[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        Registered MSBuild instance: Visual Studio Community 2019 16.8.30711.63 16.8.1 - "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin"
...
[info]: OmniSharp.MSBuild.ProjectManager
        Loading project: c:\Users\myuser\OneDrive\Documents\Programming\net6api\net6api.csproj
[fail]: OmniSharp.MSBuild.ProjectManager
        Failed to load project file 'c:\Users\myuser\OneDrive\Documents\Programming\net6api\net6api.csproj'.
Microsoft.Build.Exceptions.InvalidProjectFileException: The SDK 'Microsoft.NET.Sdk.Web' specified could not be found.  c:\Users\myuser\OneDrive\Documents\Programming\net6api\net6api.csproj
   at Microsoft.Build.Shared.ProjectErrorUtilities.ThrowInvalidProject(String errorSubCategoryResourceName, IElementLocation elementLocation, String resourceName, Object[] args)
...

Let’s try adding an omnisharp.json to the project to force it to use the embedded MSBuild 17, in case that helps…

{
    "MsBuild": {
        "MSBuildOverride": {
            "MSBuildPath": "c:\\Users\\myuser\\.vscode\\extensions\\ms-dotnettools.csharp-1.23.17\\.omnisharp\\1.37.17\\.msbuild\\Current\\Bin"
        }
    }
}

Nope:

[dbug]: OmniSharp.CompositionHostBuilder
        MSBuild instance Overridden MSBuild from c:\Users\myuser\.vscode\extensions\ms-dotnettools.csharp-1.23.17\.omnisharp\1.37.17\.msbuild\Current\Bin 17.0.0 scored at 2147483647
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        Registered MSBuild instance: Overridden MSBuild from c:\Users\myuser\.vscode\extensions\ms-dotnettools.csharp-1.23.17\.omnisharp\1.37.17\.msbuild\Current\Bin 17.0.0 - "c:\Users\myuser\.vscode\extensions\ms-dotnettools.csharp-1.23.17\.omnisharp\1.37.17\.msbuild\Current\Bin"
...
[info]: OmniSharp.MSBuild.ProjectManager
        Loading project: c:\Users\myuser\OneDrive\Documents\Programming\net6api\net6api.csproj
[fail]: OmniSharp.MSBuild.ProjectManager
        Failed to load project file 'c:\Users\myuser\OneDrive\Documents\Programming\net6api\net6api.csproj'.
Microsoft.Build.Exceptions.InvalidProjectFileException: The imported project "c:\Users\myuser\.vscode\extensions\ms-dotnettools.csharp-1.23.17\.omnisharp\1.37.17\.msbuild\Current\Bin\Current\Microsoft.Common.props" was not found. Also, tried to find "Current\Microsoft.Common.props" in the fallback search path(s) for $(MSBuildExtensionsPath) - "C:\Program Files (x86)\MSBuild" . These search paths are defined in "c:\Users\myuser\.vscode\extensions\ms-dotnettools.csharp-1.23.17\.omnisharp\1.37.17\OmniSharp.exe.Config". Confirm that the path in the <Import> declaration is correct, and that the file exists on disk in one of the search paths.  C:\Program Files\dotnet\sdk\6.0.100\Sdks\Microsoft.NET.Sdk\Sdk\Sdk.props
   at Microsoft.Build.Shared.ProjectErrorUtilities.ThrowInvalidProject(String errorSubCategoryResourceName, IElementLocation elementLocation, String resourceName, Object[] args)
...

Let’s install VS 2022 build tools, remove global.json, and remove omnisharp.json. That should work, right? Nope…it’s back to preferring VS 2019 MSBuild again.

[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        Located 5 MSBuild instance(s)
            1: Visual Studio Build Tools 2017 15.9.28307.1146 15.9.21 - "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin"
            2: Visual Studio Community 2017 15.9.28307.665 15.9.21 - "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin"
            3: Visual Studio Build Tools 2022 17.0.31919.166 17.0.0 - "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Current\Bin"
            4: Visual Studio Community 2019 16.8.30711.63 16.8.1 - "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin"
            5: StandAlone 17.0.0 - "c:\Users\myuser\.vscode\extensions\ms-dotnettools.csharp-1.23.17\.omnisharp\1.37.17\.msbuild\Current\Bin"
[dbug]: OmniSharp.CompositionHostBuilder
        MSBuild instance Visual Studio Build Tools 2017 15.9.28307.1146 15.9.21 scored at -2147483648
[dbug]: OmniSharp.CompositionHostBuilder
        MSBuild instance Visual Studio Community 2017 15.9.28307.665 15.9.21 scored at -2147483648
[dbug]: OmniSharp.CompositionHostBuilder
        MSBuild instance Visual Studio Build Tools 2022 17.0.31919.166 17.0.0 scored at -2147483648
[dbug]: OmniSharp.CompositionHostBuilder
        MSBuild instance Visual Studio Community 2019 16.8.30711.63 16.8.1 scored at 2
[dbug]: OmniSharp.CompositionHostBuilder
        MSBuild instance StandAlone 17.0.0 scored at 1
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        Registered MSBuild instance: Visual Studio Community 2019 16.8.30711.63 16.8.1 - "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin"

My final attempt is to have omnisharp.json force it to use C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Current\Bin for MSBuild.

{
    "MsBuild": {
        "MSBuildOverride": {
            "MSBuildPath": "C:\\Program Files (x86)\\Microsoft Visual Studio\\2022\\BuildTools\\MSBuild\\Current\\Bin"
        }
    }
}

That doesn’t work either. I’m getting the same error as initially, but at this point a global.json no longer seems to be necessary because it’s now the same error with or without that.

[info]: OmniSharp.MSBuild.ProjectManager
        Loading project: c:\Users\myuser\OneDrive\Documents\Programming\net6api\net6api.csproj
[fail]: OmniSharp.MSBuild.ProjectManager
        Failed to load project file 'c:\Users\myuser\OneDrive\Documents\Programming\net6api\net6api.csproj'.
Microsoft.Build.Exceptions.InvalidProjectFileException: The SDK 'Microsoft.NET.Sdk.Web' specified could not be found.  c:\Users\myuser\OneDrive\Documents\Programming\net6api\net6api.csproj

What is going wrong here? I should mention that dotnet build works fine, so I doubt there is a problem with the actual template project.

Environment information

VSCode version: 1.62.3 C# Extension: 1.23.17

Dotnet Information .NET SDK (reflecting any global.json): Version: 6.0.100 Commit: 9e8b04bbff

Runtime Environment: OS Name: Windows OS Version: 10.0.18363 OS Platform: Windows RID: win10-x64 Base Path: C:\Program Files\dotnet\sdk\6.0.100\

Host (useful for support): Version: 6.0.0 Commit: 4822e3c3aa

.NET SDKs installed: 1.0.0 [C:\Program Files\dotnet\sdk] 2.1.104 [C:\Program Files\dotnet\sdk] 2.1.202 [C:\Program Files\dotnet\sdk] 2.1.507 [C:\Program Files\dotnet\sdk] 2.1.802 [C:\Program Files\dotnet\sdk] 2.2.402 [C:\Program Files\dotnet\sdk] 5.0.100 [C:\Program Files\dotnet\sdk] 6.0.100 [C:\Program Files\dotnet\sdk]

.NET runtimes installed: Microsoft.AspNetCore.All 2.1.11 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All] Microsoft.AspNetCore.All 2.1.13 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All] Microsoft.AspNetCore.All 2.1.23 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All] Microsoft.AspNetCore.All 2.2.7 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All] Microsoft.AspNetCore.All 2.2.8 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All] Microsoft.AspNetCore.App 2.1.11 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 2.1.13 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 2.1.23 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 2.2.7 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 2.2.8 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 3.1.9 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 5.0.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 6.0.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.NETCore.App 1.0.4 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 1.1.1 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.0.6 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.0.9 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.1.11 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.1.13 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.1.23 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.2.7 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.2.8 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 3.1.9 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 5.0.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 6.0.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.WindowsDesktop.App 3.1.9 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 5.0.0 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 6.0.0 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

To install additional .NET runtimes or SDKs: https://aka.ms/dotnet-download

Visual Studio Code Extensions
Extension Author Version
csharp ms-dotnettools 1.23.17
EditorConfig EditorConfig 0.16.4
shellcheck timonwong 0.18.2

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

3reactions
filipwcommented, Dec 3, 2021

All the other Visual Studio and Build Tools you are missing .NET SDK resolvers (see https://github.com/OmniSharp/omnisharp-roslyn/blob/master/src/OmniSharp.Host/MSBuild/Discovery/Extensions.cs#L143-L147) since they are scored as int.MinValue.

In fact when you set the MSBuild path to VS 2022 manually it complained about missing Microsoft.NET.Sdk.Web which indicates missing resolvers.

You should either update those installations and include dotnet SDK tools or you can force OmniSharp to use its bundled MSBuild by setting this in omnisharp.json

{ 
   "msbuild": {  "useBundledOnly": true } 
}
2reactions
filipwcommented, Dec 6, 2021

I will close this because this behavior is currently by design. Thanks.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Getting Error on Visual Studio Code for OmniSharp with .Net6 ...
Net6 project. There are some errors I am getting in the compiler. it starts with "C# extension Some projects have trouble loading.
Read more >
C# - Visual Studio Marketplace
Support for project.json and csproj projects on Windows, macOS and Linux. The C# extension is powered by OmniSharp. Requirements .NET 6 SDK ...
Read more >
OmniSharp - .NET and IntelliSense on any platform with your ...
OmniSharp is a set of tooling, editor integrations and libraries that together create an ecosystem that allows you to have a great programming...
Read more >
Announcing .NET 6 - The Fastest .NET Yet - .NET Blog
NET 6 is now available. It is easier to use, runs faster, and has many new features.
Read more >
VSCode omnisharp not loading - Unity Answers
This project targets .NET version that requires reference assemblies that are not installed (e.g ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found