vscode-csharp
vscode-csharp copied to clipboard
MSBuildSdksPath ingored
Environment data
VS Code version: 1.67.0 C# Extension version: v1.24.4
Steps to reproduce
- Create 'omnipath.json' in project's folder
{ "msbuild": { "MSBuildSdksPath": "C:\\Windows\\Microsoft.NET\\Framework\\v3.5" } }
Actual behavior
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
Registered MSBuild instance: Visual Studio Professional 2022 17.1.32421.90 17.1.0 - "C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin"
Additional context
the MSBuild path is not overwritten.
This is a legacy configuration option that only works when
{
"MSBuild": {
"UseLegacySdkResolver": true
}
}
is also set.
Thank you for the answer. But I can't see any difference in the OmniSharp output log. Actually, I don't understand if omnipath.json has been considered or not
if you set "omnisharp.loggingLevel":"debug"in VS Code (not in theomnisharp.jsonfile) it will show the full configuration state it observes, from that it will be visible whether the settings of youromnisharp.json` file were included.
Note that omnisharp.json must be located at the root path of your solution.
ok... now this is my omnisharp.json:
{
"msbuild": {
"UseLegacySdkResolver": true,
"MSBuildSDKsPath": "C:\\Windows\\Microsoft.NET\\Framework\\v4.0.30319",
"MSBuildOverride": {
"MSBuildPath": "C:\\Windows\\Microsoft.NET\\Framework\\v4.0.30319",
"Name": "MSBuildOverride"
}
}
}
but now i have this error:
[dbug]: OmniSharp.CompositionHostBuilder
.NET SDK requires MSBuild instances version 16.3 or higher
System.FormatException: input string was not in a correct format.
in OmniSharp.SemanticVersion.VersionResult.SetFailure(ParseFailureKind failure, String argument) in D:\a\1\s\src\OmniSharp.Abstractions\SemanticVersion.cs:riga 557
in OmniSharp.SemanticVersion.TryParseVersion(String version, VersionResult& result) in D:\a\1\s\src\OmniSharp.Abstractions\SemanticVersion.cs:riga 288
in OmniSharp.SemanticVersion.Parse(String version) in D:\a\1\s\src\OmniSharp.Abstractions\SemanticVersion.cs:riga 183
in OmniSharp.MSBuild.Discovery.MSBuildInstanceProvider.GetMSBuildVersion(String microsoftBuildPath) in D:\a\1\s\src\OmniSharp.Host\MSBuild\Discovery\MSBuildInstanceProvider.cs:riga 67
@krosthw This is a very strange configuration. What are you trying to accomplish?
I have an old project, at the moment I can use only visual studio 2008 as IDE. I'm trying to port it in VS Code, with omnisharp, in order to find if it is possible to have better editing support.