NETMF Nuget问题 - 这部分URI已经包含在包中

问题描述:

我正努力为.NET MicroFramework项目构建nuget包。NETMF Nuget问题 - 这部分URI已经包含在包中

这是我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不是成为一个问题。

这里的任何想法?

解决了这个问题。需要确保对目标文件有独特的文件夹,因此这样的:

<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" />