无法创建仅包含内容的包

时间:2018-06-19 18:37:51

标签: nuget

我只是想创建一个发布到内部存储库中的nuget内容包,我可以从.Net framework 4.6.2项目中引用它。当我尝试使用Visual Studio 2017安装软件包时,出现错误:

“无法安装软件包'MyPackage'。您正在尝试将此软件包安装到以'.NETFramework,Version = v4.6.2'为目标的项目中,但是该软件包不包含任何程序集引用或内容文件与该框架兼容。有关更多信息,请与软件包作者联系。“

我正在使用nuget.exe版本4.6.2打包/推送软件包。

一个同事创建了一个仅安装内容的软件包,该软件包可以很好地安装。在安装他的软件包期间,我在输出中看到:

将仅具有工具组的软件包“ HisPackage”添加到项目“ SameProject”

但是,即使我恰好在nuspec文件之后对我的nuspec文件进行构图,我也会得到相同的结果。他的nuspec的相关部分看起来像:

<package>  
  <metadata>  
  ..  
  </metadata>  
  <files>  
    <file src=".\init.ps1" target="tools\init.ps1" />  
    <file src=".\some.exe" target="lib\some.exe" />  
    ..  
  </files>  
</package>`  

我尝试过的事情:
-<files><file src="whatever.txt" target="ParentDir\any" />
-<files><file src=".\whatever.txt" target="tools\whatever.txt" />就像同事的
-<files><file src=".\whatever.txt" target="content\whatever.txt" />完全与docs中指定的相同
-<files><files include="content/SomeDir/**/*" buildAction="None" />(基于this,即使它很旧)
-<contentFiles><files include="SomeDir/**/*" buildAction="None" flatten="true" />
-<contentFiles><files include="./SomeDir/*.*" buildAction="None" />
-<contentFiles><file src="SomeDir\**" target="tools" />像上面的输出消息一样思考“工具”
-<contentFiles><files include="whatever.txt" buildAction="None" copyToOutput="true" />
-不使用文件也不使用contentFiles。仍然打包与.nuspec在同一目录中的内容。
-与上述相同,但将我的内容放在父内容目录中。
-所有建议here
-Converted project to PackageReference。这导致软件包安装无误,但从未交付任何内容。尽管contentFiles,文件夹结构等有许多排列方式,但仍然如此。

0 个答案:

没有答案