我正努力为.NET MicroFramework项目构建一个nuget包。
这是我的nuspec文件:
<?xml version="1.0"?>
<package >
<metadata>
<id>WildernessLabs.Netduino.Foundation</id>
<title>Netduino.Foundation</title>
<version>1.0.0.0</version>
<authors>Bryan Costanich, Frank Krueger, Craig Dunn</authors>
<owners>Wilderness Labs</owners>
<licenseUrl>https://github.com/WildernessLabs/Netduino.Foundation/blob/master/LICENSE</licenseUrl>
<projectUrl>https://github.com/WildernessLabs/Netduino.Foundation</projectUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>Netduino.Foundation greatly simplifies the task of building complex .NET Microframework (MF) powered connected things with Netduino.</description>
<copyright>Copyright 2017 Wilderness Labs</copyright>
<tags>NETMF Netduino</tags>
</metadata>
<files>
<file src="bin/Release/Netduino.Foundation.*" target="lib/netmf" />
<file src="bin/Release/le/Netduino.Foundation.*" target="lib/netmf" />
<file src="bin/Release/be/Netduino.Foundation.*" target="lib/netmf" />
</files>
</package>
它与我的.csproj
文件位于同一文件夹中。当我运行nuget pack Netduino.Foundation.nuspec -verbosity detailed
时,我收到以下错误:
System.InvalidOperationException: This partUri is already contained in the package
我在这里唯一能想到的是bin
,/be
和/le
文件夹包含Netduino.Foundation.dll
,但在审核other NETMF .nuspec files时似乎是一个问题。
这里有什么想法吗?
答案 0 :(得分:0)
解决了这个问题。需要确保文件的目标具有唯一文件夹,因此:
<file src="bin/Release/Netduino.Foundation.*" target="lib/netmf" />
<file src="bin/Release/le/Netduino.Foundation.*" target="lib/netmf" />
<file src="bin/Release/be/Netduino.Foundation.*" target="lib/netmf" />
变为:
<file src="bin/Release/Netduino.Foundation.*" target="lib/netmf43/" />
<file src="bin/Release/le/Netduino.Foundation.*" target="lib/netmf43/le" />
<file src="bin/Release/be/Netduino.Foundation.*" target="lib/netmf43/be" />