我目前正在创建一个NuGet包用nuspec文件,但得到以下错误:一个具有相同的键项已经添加的NuGet错误
An item with the same key has already been added.
我用我的命令是:
nuget pack "MyProject.csproj" -o "..\Packages"
这是我nuspec文件:
<?xml version="1.0"?>
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata>
<id>$id$</id>
<version>$version$</version>
<title>$title$</title>
<authors>$author$</authors>
<owners>$author$</owners>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>$description$</description>
<language>$language$</language>
</metadata>
<files>
<file src="bin\MyLibrary*.dll" target="lib\net45" />
</files>
</package>
我使用的包装等包装withing的时候也使用的nuspec文件同一个库。这可能是上述错误发生的原因吗?有任何想法吗?
我已经添加了nuspec文件到我的问题。是的,你所概述的是正确的。但是,如果我从我的nuspec文件中删除文件引用,他们不会被安装在消费项目中。他们会吗?如果有帮助, – amateur
已经更新了内联答案。 – Deepak