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

Fix MSBuild version mismatch with new SDKs #1883

Merged
merged 8 commits into from
Aug 12, 2020

Conversation

JoeRobich
Copy link
Member

@JoeRobich JoeRobich commented Aug 12, 2020

The 3.1.401 SDK's minimumMSBuildVersion is 16.7.0. The latest stable and preview versions of Mono ship with 16.6.0. This causes the DotNet.MSBuildSDKResolver to no longer find the sdks needed to load projects.

Possibilities for working around this:

  • Enable LegacySDKResolver by default
  • Rewrite the LegacySDKResolver as a true SDKResolver to be consumed by the included MSBuild, but set the priority such that is only used as a last resort.
  • Ship the MSBuild from the tools/packages.json
  • Ship the MSBuild from Mono 6.13.x

Since we already ship the MSBuild from tools/packages on the Windows platform, this may be the easiest path to take.

Fixes dotnet/vscode-csharp#3951

Comment on lines +212 to 216
var msbuildRefLibraries = new []
{
"Microsoft.Build.Tasks.v4.0",
"Microsoft.Build.Tasks.v12.0",
"Microsoft.Build.Utilities.v4.0",
Copy link
Member Author

Choose a reason for hiding this comment

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

There are no NuGet packages for these but we can still copy them from the Mono MSBuild folder.

Comment on lines +60 to +63
<PackageReference Update="NuGet.Packaging" Version="$(NuGetPackageVersion)" />
<PackageReference Update="NuGet.Packaging.Core" Version="$(NuGetPackageVersion)" />
<PackageReference Update="NuGet.ProjectModel" Version="$(NuGetPackageVersion)" />
<PackageReference Update="NuGet.Versioning" Version="$(NuGetPackageVersion)" />
Copy link
Member Author

Choose a reason for hiding this comment

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

This only seemed to be an issue in the Linux build surprisingly

Comment on lines -152 to -158
SendMessage(MessageType.GetTestRunnerProcessStartInfoForRunSelected,
new
{
TestCases = testCases,
DebuggingEnabled = true,
RunSettings = LoadRunSettingsOrDefault(runSettings, targetFrameworkVersion)
});
Copy link
Member Author

Choose a reason for hiding this comment

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

This should have been removed when I extracted out the GetTestRunningProcessStartInfo method

Comment on lines +11 to +24
private const string DotNetVersion = "3.1.401";
private int Major { get; }
private int Minor { get; }
private int Patch { get; }
private string Release { get; }

public DotNetCliServiceFacts(ITestOutputHelper output)
: base(output)
{
var version = SemanticVersion.Parse(DotNetVersion);
Major = version.Major;
Minor = version.Minor;
Patch = version.Patch;
Release = version.Release;
Copy link
Member Author

Choose a reason for hiding this comment

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

This should make future SDK updates easier since the version string can be updated with a replace all.

@JoeRobich JoeRobich changed the title Investigate how to fix MSBuild version mismatch Fix MSBuild version mismatch with new SDKs Aug 12, 2020
@JoeRobich JoeRobich marked this pull request as ready for review August 12, 2020 05:21
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.

With SDK 3.1.401, loading .NET Core projects with some problems in VSCode.
2 participants