Skip to content

Omnisharp fails to load .NET Framework projects when VS 2026 is installed #2705

Description

@dhull-aptos-com

Omnisharp does not support the VS 2026 version of MSBuild. Exceptions are thrown as it attempts to load the project files. It detects three versions of MSBuild on my system in this order: VS 2026, Build Tools for VS 2019, and VS 2022. It assigns a weight of 2 to each and then just defaults to the first one.

I examined the Omnisharp source code and found that you should be able to override the version of MSBuild in the msbuild.msbuildoverride property of the .vscode\omnisharp.json. However, this does not appear to work for me.

I am running the latest release 1.39.15 of omnisharp in the Cursor AI fork of VSCode. Here is a copy of my omnisharp.json file:

{
"msbuild": {
"enabled": true,
"ToolsVersion": "Current",
"VisualStudioVersion": "17.0",
"Configuration": null,
"Platform": null,
"EnablePackageAutoRestore" : false,
"MSBuildExtensionsPath": "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin",
"TargetFrameworkRootPath": "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework",
"MSBuildSDKsPath": "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Sdks",
"RoslynTargetsPath" : null,
"CscToolPath": null,
"CscToolExe": null,
"loadProjectsOnDemand": false,
"GenerateBinaryLogs": false,
"msbuildoverride": {
"Name": "MSBuild VS2022",
"MSBuildPath": "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin"
}
}

I've done everything that I can think of to redirect Omnisharp to use the VS 2022 version of MSBuild. I would appreciate any help that you can provide.

I uninstalled VS 2026 and now my .NET Framework projects are loading in Omnisharp.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions