commandline icon indicating copy to clipboard operation
commandline copied to clipboard

Version 2.4.x is not compatible with net451 - version 2.3.x is

Open djeec opened this issue 7 years ago • 11 comments

When trying to add package version 2.4.x to my application, I get NU1202: Package CommandLineParser 2.4.3 is not compatible with net451 (.NETFramework,Version=v4.5.1). Package CommandLineParser 2.4.3 supports: netstandard2.0 (.NETStandard,Version=v2.0)

Version 2.3.x works no problem.

djeec avatar Jan 11 '19 15:01 djeec

Minimum version for adopting .NET Standard 2.0 is .NET 4.6.1

Also Microsoft has dropped support for 4.5.1 now https://blogs.msdn.microsoft.com/dotnet/2015/12/09/support-ending-for-the-net-framework-4-4-5-and-4-5-1/

glennawatson avatar Jan 13 '19 19:01 glennawatson

Hello, I get an error message also when trying to update to 2.4.3 under .NET 4.6.1 (via NUGET):

Could not install package 'CommandLineParser 2.4.3'. You are trying to install this package into a project that targets '.NETFramework,Version=v4.6.1', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author.

gurru68 avatar Jan 15 '19 14:01 gurru68

what version of visual studio etc you running? .NET 4.6.1 is compatible with .NET Standard 2.0 libraries but I could imagine you getting that error if your Nuget is out of date or something.

glennawatson avatar Jan 15 '19 16:01 glennawatson

I'm running VS 2015 Pro / NUGET 3.5.0.1484. I also tried to update NUGET to the latest available for VS2015 (3.6.0.2511) but I still get an error.

I notice that the version 2.3.0 NUGET package declares its dependencies (1st screenshot) while version 2.4.3 does not. capture capture2

gurru68 avatar Jan 15 '19 16:01 gurru68

https://github.com/dotnet/cli/issues/6739

They mention in that problem there is a compatibility pack for .net standard 2.0 and VS 2015

glennawatson avatar Jan 15 '19 17:01 glennawatson

I agree that the missing dependencies are why the package is being offered as an updated package. If minimum version is set the nuget will not offer it.

It should be mentioned that once the dependency issue is fixed, you will have to go into nuget.org and remove the 2.4.x versions that are missing the dependency info.

kellcomnet2 avatar Jan 17 '19 20:01 kellcomnet2

Hmmm, thats odd its missing at least the base dependency of NetStandard 2.0

I'll look into this

ericnewton76 avatar Jan 17 '19 23:01 ericnewton76

Here's what I see when I downloaded the artifacts from the build server: (Nuget package explorer) image Correctly shows NetStandard 2.0 dependency.

Here's Nuget Package Explorer directly accessing the package from the Nuget.org feed: image Correctly shows NetStandard 2.0 dependency.

Here's what I see in VS2017: image So I believe part of this is (as usual) another inconsistency in Nuget itself.

I find it amazing that the Nuget team is directly tying their ~~pos~~ package manager to visual studio versions, a luxury that virtually no other package manager has ever tried to enforce. Sorry, I get upset when discussing Nuget, I've gone several rounds with those fellas.

Sorry, I'm not able to assist here... I do believe, as mentioned above, for VS2015 you'll need to install that compatibility pack as mentioned. We do have another "restore net45" issue #388 thread running, and a proposed PR #387 to deal with it.

ericnewton76 avatar Jan 17 '19 23:01 ericnewton76

That being said above, theres a lot of code in the library that uses type reflection code (kinda important here) that appears to not work below 4.5.1

ericnewton76 avatar Jan 18 '19 00:01 ericnewton76

What about 4.6? Same problem with that .NET version

Gusi avatar Feb 01 '19 11:02 Gusi

Successfully installed this package after upgrading .Net framework from 4.5.2 to 4.6.2.

Should the Readme be updated to read "Compatible with .NET Framework 4.6.x+"?

MonkeyAlex avatar Apr 25 '19 21:04 MonkeyAlex