NuGet安装包报错
NuGet installing package error
我目前正在尝试为 zLib (http://www.zlib.net/) 创建一个 NuGet 包。
我使用 "grpc zlib" NuGet 包 (https://www.nuget.org/packages/grpc.dependencies.zlib/) 复制文件夹结构,然后添加 zLib .dll、.lib 和头文件。
这是我自己制作的 zlib NuGet 包:https://drive.google.com/file/d/0B_2A8x02vzDwOWVGUmxkeGdBNm8/view?usp=sharing
然而,当我尝试在 VS 中安装我的包时,出现以下错误:
Severity Code Description Project File Line Suppression State
Error Could not install package '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.
For more information, contact the package author. 0
使用 grpc zlib 包工作正常。
提前感谢您的帮助!
您需要添加 .targets 以识别程序包中的程序集和 winmd 文件。
根据错误和您的包,您的 \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.
请参考this link中的“添加.targets”部分。
.targets的详细信息,请关注文档中的.targets内容:Deep Dive into NuGet Native,注意.targets必须与.targets的包ID同名and/or .props 扩展名。
很明显,我的 NuGet 包的问题是缺少 .targets 文件。
我使用 this and this 添加了文件(感谢@Wendy - MSFT)寻求帮助。我还查看了一些现有 zlib-packages 的 .target 文件,以确定文件的外观。
我目前正在尝试为 zLib (http://www.zlib.net/) 创建一个 NuGet 包。 我使用 "grpc zlib" NuGet 包 (https://www.nuget.org/packages/grpc.dependencies.zlib/) 复制文件夹结构,然后添加 zLib .dll、.lib 和头文件。
这是我自己制作的 zlib NuGet 包:https://drive.google.com/file/d/0B_2A8x02vzDwOWVGUmxkeGdBNm8/view?usp=sharing
然而,当我尝试在 VS 中安装我的包时,出现以下错误:
Severity Code Description Project File Line Suppression State Error Could not install package '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. For more information, contact the package author. 0
使用 grpc zlib 包工作正常。
提前感谢您的帮助!
您需要添加 .targets 以识别程序包中的程序集和 winmd 文件。
根据错误和您的包,您的 \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.
请参考this link中的“添加.targets”部分。
.targets的详细信息,请关注文档中的.targets内容:Deep Dive into NuGet Native,注意.targets必须与.targets的包ID同名and/or .props 扩展名。
很明显,我的 NuGet 包的问题是缺少 .targets 文件。 我使用 this and this 添加了文件(感谢@Wendy - MSFT)寻求帮助。我还查看了一些现有 zlib-packages 的 .target 文件,以确定文件的外观。