Nuget package installation failure(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 包资源管理器的屏幕截图)
The Nuget package also targets 4.5.1. (Screenshot take from Nuget Package Explorer)
Nuget 包由 Octopack 通过本地 TFS 创建,然后发布到私有 Proget 服务器
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包安装失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:Nuget包安装失败


基础教程推荐
- 如何在 IDE 中获取 Xamarin Studio C# 输出? 2022-01-01
- 为什么Flurl.Http DownloadFileAsync/Http客户端GetAsync需要 2022-09-30
- 将 Office 安装到 Windows 容器 (servercore:ltsc2019) 失败,错误代码为 17002 2022-01-01
- SSE 浮点算术是否可重现? 2022-01-01
- c# Math.Sqrt 实现 2022-01-01
- rabbitmq 的 REST API 2022-01-01
- 将 XML 转换为通用列表 2022-01-01
- MS Visual Studio .NET 的替代品 2022-01-01
- 如何激活MC67中的红灯 2022-01-01
- 有没有办法忽略 2GB 文件上传的 maxRequestLength 限制? 2022-01-01