简体   繁体   English

NuGet安装软件包错误

[英]NuGet installing package error

i am currently trying to create a NuGet package for zLib ( http://www.zlib.net/ ). 我目前正在尝试为zLib( http://www.zlib.net/ )创建一个NuGet软件包。 I used the "grpc zlib" NuGet package ( https://www.nuget.org/packages/grpc.dependencies.zlib/ ) to copy the folder structure and then added the zLib .dll, .lib and header files. 我使用“ grpc zlib” NuGet包( https://www.nuget.org/packages/grpc.dependencies.zlib/ )复制文件夹结构,然后添加了zLib .dll,.lib和头文件。

This is my self crafted zlib NuGet-package: https://drive.google.com/file/d/0B_2A8x02vzDwOWVGUmxkeGdBNm8/view?usp=sharing 这是我自制的zlib NuGet软件包: https ://drive.google.com/file/d/0B_2A8x02vzDwOWVGUmxkeGdBNm8/view?usp = sharing

However when i try to install my package in VS, then i get following error: 但是,当我尝试在VS中安装软件包时,出现以下错误:

Severity Code Description Project File Line Suppression State Error Could not install package 'zlib 1.2.8'. 严重性代码说明项目文件行抑制状态错误无法安装软件包'zlib 1.2.8'。 You are trying to install this package into a project that targets 'native,Version=v0.0', but the package does not contain any assembly references or content files that are compatible with that framework. 您正在尝试将此软件包安装到面向“ native,Version = v0.0”的项目中,但是该软件包不包含任何与该框架兼容的程序集引用或内容文件。 For more information, contact the package author. 有关更多信息,请与软件包作者联系。 0 0

Using the grpc zlib package is working fine. 使用grpc zlib软件包可以正常工作。

Thanks for your help in advance! 谢谢您的帮助!

You need add the .targets in to identify the assembly and winmd files in your package. 您需要在其中添加.targets来标识程序包中的程序集和winmd文件。

According to the error and your package, the .targets /or .props was missing in your \\build folder. 根据错误和您的软件包,\\ build文件夹中缺少.targets /.props。

C++ and JavaScript projects that might consume your NuGet package need a .targets file to identify the necessary assembly and winmd files. 可能会消耗您的NuGet包的C ++和JavaScript项目需要一个.targets文件来标识必要的程序集和winmd文件。

Please refer to the “Adding .targets” part in this link . 请参阅此链接中的“添加.targets”部分。

Detailed information for .targets, please focus on .targets content in the document: Deep Dive into NuGet Native , and pay attention that .targets must be named the same as the package ID with the .targets and/or .props extensions. 有关.targets的详细信息,请重点关注文档中的.targets内容: 深入研究NuGet Native ,并注意.targets必须与带有.targets和/或.props扩展名的软件包ID命名相同。

Well the point with my NuGet-package obviously was that there was the .targets file missing. 好吧,我的NuGet软件包的要点显然是缺少.targets文件。 I added the file using this and this (thanks to @Wendy - MSFT) for help. 我添加使用文件这个这个 (感谢@Wendy - MSFT)寻求帮助。 I also looked at .target files of some existing zlib-packages to figure out, how the file has to look like. 我还查看了一些现有zlib-packages的.target文件,以弄清该文件的外观。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 安装 NuGet 包时未找到项目“默认”错误 - Project 'Default' not found error when installing a NuGet package 在VS2015中安装NuGet包时出现TFS204018错误 - TFS204018 error when installing NuGet Package in VS2015 NuGet软件包管理器是否返回错误? - Is the NuGet Package Manager returning an error? 在 VS2015 中从包管理器控制台安装 Entityframework 7 时出现 Nuget 错误“对象引用未设置为对象的实例” - Nuget error “Object reference not set to an instance of an object” while installing Entityframework 7 from Package Manager Console in VS2015 安装NuGet软件包时如何指定语言和体系结构? - How do I specify language and architecture when installing a NuGet package? 从nuget安装包将项目添加到Visual Studio 2015中的解决方案 - Installing package from nuget adds project to solution in Visual Studio 2015 安装Nuget Package错误“​​路径不是合法形式” - Install Nuget Package error “The path is not of a legal form” 在VS 2015中安装nuget软件包时检索软件包元数据时出错 - Error while retrieving package metadata in installation of nuget package in VS 2015 在UWP应用中安装googleanalyticssdk时出现Nuget参考错误 - Nuget Reference error while installing googleanalyticssdk in UWP app 如何解决错误安装 Twilio NUGET - How do I resolve error Installing Twilio NUGET
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM