Error installing Nuget package

When I try to install a package from our newly created private Nuget channel, I get the following error.

Failed to install package 'GC.Timecode 1.0.0.3'. You are trying to install this package in a project that targets ".NETFramework, Version = v4.5.1," but the package does not contain any references to assemblies or content files compatible with this platform.

The Nuget package is also intended for 4.5.1. (Screenshot taken from Nuget Package Explorer)

The Nuget package is created by Octopack through a local TFS and then published to a private Proget server.

enter image description here

Nuspec file looks like this

<?xml version="1.0"?>
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata>
<id>GC.Timecode</id>
<version>1.0.0.3</version>
<authors>user</authors>
<owners>user</owners>
<licenseUrl>http://example.com</licenseUrl>
<projectUrl>http://example.com</projectUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>The GC.Timecode deployment package, built on 25/01/2016</description>
<releaseNotes />
</metadata>
</package>

Package Content

enter image description here

What's going on here?

+13
source share
7 answers

.

, , :

" ". > , ".NETFramework, Version = v4.6.1", > , . > .

, Nuget "lib\net45", !

Tools- > Options- > Nuget- > General .

+17

, nuspec 'lib/net45'

<package>
  <metadata>
    ...
  </metadata>
  <files>
    <file src="bin\Release\*.*" target="lib/net45" />
  </files>
</package>
+11

, , , , , - .

, , :

" ". , '.NETFramework, Version = v4.6.1', , . .

Nuget, 4.x, , 4.6.1. 4.0, 4.5, 4.5.2, 4.6, 4.6.1 4.6.2, . DLL /lib/Net 4 (5,51,52,6,61,62), .

, , Nuget, , "" , .

Nuget- ( ), Nuget Visual Studio , , . , Nuget, . :

C:\Users\your_user_account \.Nuget\\

, .

+6

nuspec, , "" .

<dependencies>
      <dependency id="MyIncludedPackage" version="1.13.0" />
    </dependencies>
  </metadata>

.

+1

.

" ". , ".NETFramework, Version = v4.6.1", , . .

, packages.config PackageReference .

+1

, , , Nuget .

https://github.com/alastairtree/LazyCache, .Net 2.0. .NET Framework 4.7.2, . , .

, Nuget VS2015 . ""> "" , https://www.nuget.org/downloads Nuget ( , 3,6 3,4).

, . , Nuget , .NET Standard.

0
source

Source: https://habr.com/ru/post/1625821/


All Articles