Nuget包安装失败

Nuget package installation failure(Nuget包安装失败)
本文介绍了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包安装失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

c# Generic Setlt;Tgt; implementation to access objects by type(按类型访问对象的C#泛型集实现)
InvalidOperationException When using Context Injection in ASP.Net Core(在ASP.NET核心中使用上下文注入时发生InvalidOperationException)
quot;Overflowquot; compiler error with -9223372036854775808L(编译器错误-9223372036854775808L(Q;溢出Q))
Visual Studio 2010 ReportViewer Assembly References(Visual Studio 2010 ReportViewer程序集引用)
Weird behaviour when I open a reportviewer in WPF(在WPF中打开报表查看器时出现奇怪的行为)
how do i pass parameters to aspnet reportviewer(如何将参数传递给aspnet report查看器)