Nuget软件包安装失败 [英] Nuget package installation failure

查看:665
本文介绍了Nuget软件包安装失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尝试从我们新创建的私有Nuget Feed安装软件包时,出现以下错误。

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

无法安装软件包 GC.Timecode 1.0.0.3。您正在尝试将此软件包安装到以 .NETFramework,Version = v4.5.1为目标的项目中,但是该软件包不包含任何与该框架兼容的程序集引用或内容文件。

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.

Nuget软件包还针对4.5.1。 (来自Nuget Package Explorer的截图)

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

Nuget Package由Octopack通过本地TFS创建,然后发布到私有的Proget Server

The Nuget Package is created by Octopack via On premises TFS, and then published to a private Proget Server

Nuspec文件如下

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>

包装内容

这是怎么回事?

推荐答案

问题在于Octopack默认情况下将仅复制现有的文件夹结构,而Nuget会将您的dll打包到一个lib文件夹中。

The problem was that Octopack will by default just replicate the existing folder structure, whereas Nuget will package your dll into a lib folder.

对于懒惰的人,您可以使用此软件包,以获取在每次构建时构建的nuget软件包

For the lazy, you can use this package in order to Get a nuget package built on every build

https://www.nuget.org/packages/CreateNewNuGetPackageFromProjectAfterEachBuild/

这篇关于Nuget软件包安装失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆