Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
751 views
in Technique[技术] by (71.8m points)

.net - Nuget package installation failure

When trying to install a package from our newly created private Nuget Feed i get the following error.

Could not install package 'GC.Timecode 1.0.0.3'. You are trying to install this package into a project that targets '.NETFramework,Version=v4.5.1', but the package does not contain any assembly references or content files that are compatible with that framework.

The Nuget package also targets 4.5.1. (Screenshot take from Nuget Package Explorer)

The Nuget Package is created by Octopack via On premises 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>

Contents of Package

enter image description here

What's going on here?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Slippery Pete fixed this problem for me.

The first time I tried to install my Assembly I got:

Could not install package 'Package Name'. 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.

After ensuring my Assembly within the Nuget package was in the 'lib et45' folder, I still got the error!

However after going to Tools->Options->Nuget->General and clearing the cache, the problem was solved.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...