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.

Ensure errors from resolver about mismatched .NET Core SDK versions are surfaced correctly in VS and desktop msbuild

See original GitHub issue

From @srivatsn on June 15, 2017 15:52

From @onovotny on June 15, 2017 15:40

Here’s the scenario:

Web project that has a global.json with a pinned SDK version.

Executing an msbuild /pp yields some interesting results for where the SDK’s are imported:

If the SDK version is 1.0.0-1.0.3 is: The import of the Web SDK is from: C:\Program Files\dotnet\sdk\1.0.0\Sdks\Microsoft.NET.Sdk.Web\Sdk\Sdk.props

But then the .NET Sdk is from: C:\Program Files (x86)\Microsoft Visual Studio\Preview\Enterprise\MSBuild\Sdks\Microsoft.NET.Sdk\Sdk\Sdk.props

If the SDK version is 1.0.4, both SDK’s come from the C:\Program Files\dotnet\sdk\1.0.4\Sdks\ directory.

Seems like if 1.0.4 is the min version of the SDK that will work correctly with 15.3, then if VS sees an older pinned version, it should use the upgrade wizard functionality to bump the min SDK version to 1.0.4 so things don’t act strangely for users unexpectedly.

Copied from original issue: dotnet/project-system#2450

Copied from original issue: dotnet/sdk#1348

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:23 (17 by maintainers)

github_iconTop GitHub Comments

1reaction
nguerreracommented, Oct 11, 2018

The remaining issues are tracked as follows:

Removing fallback to 1.1: https://github.com/dotnet/cli/issues/6795 Project system not showing resolver errors: https://github.com/dotnet/project-system/issues/2467

1reaction
natemcmastercommented, Nov 7, 2017

cc @davidfowl - this is the issue we were talking about. VS doesn’t show useful errors if the sdk from global.json cannot be found.

Read more comments on GitHub >

github_iconTop Results From Across the Web

NETSDK1141: Unable to resolve the .NET SDK version as ...
Learn about .NET SDK error NETSDK1141, which occurs when the SDK version could not be resolved in global.json.
Read more >
NETSDK1045: The current .NET SDK does not support ...
This error occurs when the build tools can't find the version of the .NET SDK that's needed to build a project. This is...
Read more >
How do I fix the Visual Studio compile error, "mismatch ...
This warning seems to have been introduced with the new Visual Studio 11 Beta and .NET 4.5, although I suppose it might have...
Read more >
Incompatible versions of Mono MSBuild and .NET Core ...
NET Core SDK are incompatible on Linux and macOS. If you use such combinations, it will be impossible to build your project in...
Read more >
Visual Studio 2019 unable to locate .Net Core SDK
Find the path to dotnet.exe manually (usually C:\Program Files\dotnet ) and add it to PATH. Check in Control Panel whether there is a...
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