.NET 3.0 SDK Projects not Loading

Overriding the SDK used with global.json - sort of

The solution to SDK versioning problems in projects or Solutions is to use a global.json file in the project or solution root to specify a specific version of an SDK to use with your project or solution.

In there I can specify a specific version of my SDK I want to use for this project/solution:

json
 
{
    "sdk": {
      "version": "3.0.100-preview8-013656"
    }
}

That works, but it is a terrible solution to this problem. It sucks because now I'm pinning my solution to a very specific (preview) version of the SDK. Since this project lives on GitHub and is shared anybody using the project now too ends up needing to use this same version of the SDK if I check in global.json. Alternately I can not check it in, in which case the project just won't build unless a Preview release of VS is used. Bah!

Maybe even worse using global.json, if SDKs are updated now, I have to remember to update the global.json version to get the latest SDK rather than the one that now is pinned in global.json.

I tried using more generic version numbers (3.0 and 3.0.*) which seems like a logical and expressive solution to this problem, but that doesn't appear to work - the only thing that worked for me was using a very specific version number.

猜你喜欢

转载自www.cnblogs.com/chucklu/p/12655304.html