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

Check for MSBuild version is higher than required by the .NET SDK #1875

Merged
merged 4 commits into from
Aug 8, 2020

Conversation

JoeRobich
Copy link
Member

Provide a warning when the discovered MSBuild version is lower than the minimumMSBuildVersion supported by the configured SDK.

@JoeRobich JoeRobich changed the title Check for MSBuild versiosn higher than required by the .NET SDK Check for MSBuild version is higher than required by the .NET SDK Aug 6, 2020
Copy link
Member

@filipw filipw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you for adding this

@@ -64,7 +64,8 @@ public CompositionHost Build()
// This is for tests, where the MSBuild instance may be registered early.
if (msbuildLocator.RegisteredInstance == null)
{
msbuildLocator.RegisterDefaultInstance(logger);
var dotNetInfo = dotNetCliService.GetInfo(workingDirectory);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure if it's possible to have a different global.json with different SDK versions per project - but I think it is not, so it should be fine to run this against the startup directory

src/OmniSharp.Host/MSBuild/Discovery/Extensions.cs Outdated Show resolved Hide resolved

var version = dotNetInfo.SdkVersion;
var sdksPath = dotNetInfo.SdksPath;
var minimumVersionPath = Path.Combine(sdksPath, version.ToNormalizedString(), "minimumMSBuildVersion");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is really there?! that's new to me!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was happy to find it =)

@filipw filipw merged commit 6a34f6e into OmniSharp:master Aug 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants