Commandline: Install fails to 4.6.1 project

Created on 13 Apr 2019  路  10Comments  路  Source: commandlineparser/commandline

Error message:

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.

question

Most helpful comment

It works for me.

All 10 comments

What the version of visual studio / nuget that you are using?

CommandLineParser 2.4.3' support netstandard2.0 and NETFramework,Version=v4.6.1 support using netstandard2.0 packages.
The following vs2017 SDK style project is working fine with net461:

    <Project Sdk="Microsoft.NET.Sdk">
      <PropertyGroup>
        <OutputType>Exe</OutputType>
        <TargetFramework>net461</TargetFramework>
      </PropertyGroup>
      <ItemGroup >
         <PackageReference Include="CommandLineParser" Version="2.4.3" />
       </ItemGroup>
    </Project>

Looks like I'm using VS 2015 Enterprise 14.0.25431.01 Update 3. Nuget version reported by VS is 3.4.4

The solution I'm trying it with is a very simple Command Line EXE solution/project with a small number of other references.

I just tested it with a clean, newly created solution with same error.

2.2.0 seems to install just fine.

If you are using vs2015, I think it's better to use v2.3.0. It support net45/netstandard1.5.
Nuget will install netstandard1.5 as the nearest Framework.
OK for using v2.2.0.

Install 2.4.x failed. With following error message.

Unable to install package "CommandLineParser 2.4.0". You are trying to install this package into a project with the target ".NETFramework, Version=v4.0", but the package does not contain any assembly references or content files that are compatible with the framework. For more information, please contact the package author.

  • 1 for lack of .Net 4.5 support

Could not install package 'CommandLineParser 2.4.3'. You are trying to install this package into a project that targets '.NETFramework,Version=v4.5', 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.

2.2.0 installs ok.

I have this same problem.
CommandLineParser 2.4.3, Net v 4.6, VC 2017.

This issue is resolved in the release 2.5.0

It works for me.

Was this page helpful?
0 / 5 - 0 ratings