【问题标题】:Nuget Packaging fails after automating it in VSTSNuget Packaging 在 VSTS 中自动化后失败
【发布时间】:2016-07-05 10:24:07
【问题描述】:

对于我经常用于各种项目的通用库,我设置了一个 nuget 服务器。有一段时间我手动发布了 nuget 包,例如:

nuget pack .\ProjectFolder\CommonProjectName.csproj -Symbols -Build -Properties Configuration=Release

并手动将此包推送到 nuget 服务器。

现在我想使用 VSTS Build vNext 自动发布此博客项目:http://www.codewrecks.com/blog/index.php/2015/09/26/publishing-a-nuget-package-to-nugetmyget-with-vso-build-vnext/

我使用和以前一样的 nuspec 文件:

<?xml version="1.0"?>
  <package >
    <metadata>
      <id>Common Library</id>
      <version>1.0.0.0</version>
      <title>Library Title</title>
      <authors>...</authors>
      <owners>...</owners>
      <requireLicenseAcceptance>false</requireLicenseAcceptance>
      <description>...</description>
      <releaseNotes>...</releaseNotes>
      <copyright>Copyright 2016</copyright>
      <tags>...</tags>
      <dependencies>
        <dependency id="EntityFramework" version="6.1.3" />
        <dependency id="log4net" version="2.0.4" />
        <dependency id="Microsoft.AspNet.Mvc" version="5.2.3" />
        <dependency id="Microsoft.AspNet.Razor" version="3.2.3" />
        <dependency id="Microsoft.AspNet.WebPages" version="3.2.3" />
        <dependency id="Microsoft.Web.Infrastructure" version="1.0.0.0" />
      </dependencies>
  </metadata>
</package>

现在自动化后我收到以下错误消息:

说明:程序集“bin\Release\CommonLibrary.dll”不在“lib”文件夹中,因此在将包安装到项目中时不会将其添加为参考。 解决方案:如果应该引用它,请将其移动到“lib”文件夹中。 问题:lib 文件夹外的程序集。

我阅读了 nuget 站点上的包约定部分,但我如何自动遵守这些约定。换句话说,我如何在我的 buidcontroller 的正确位置获取构建和引用的 dll。

感谢您的帮助,

亲切的问候, 卢克·克里宁

额外:在使用 FTP 下载 nuget 包后,我的完整源代码以及我编译的源代码都被添加到树中的包中,就像我的原始源代码一样。所以我编译的 dll 在 de 文件夹中 .\Bin\Release\

【问题讨论】:

    标签: nuget nuget-spec azure-pipelines


    【解决方案1】:

    将文件部分添加到 nuspec 文件添加目标似乎是解决方案:

    <?xml version="1.0"?>
      <package >
        <metadata>
          <id>Common Library</id>
          <version>1.0.0.0</version>
          <title>Library Title</title>
          <authors>...</authors>
          <owners>...</owners>
          <requireLicenseAcceptance>false</requireLicenseAcceptance>
          <description>...</description>
          <releaseNotes>...</releaseNotes>
          <copyright>Copyright 2016</copyright>
          <tags>...</tags>
          <dependencies>
            <dependency id="EntityFramework" version="6.1.3" />
            <dependency id="log4net" version="2.0.4" />
            <dependency id="Microsoft.AspNet.Mvc" version="5.2.3" />
            <dependency id="Microsoft.AspNet.Razor" version="3.2.3" />
            <dependency id="Microsoft.AspNet.WebPages" version="3.2.3" />
            <dependency id="Microsoft.Web.Infrastructure" version="1.0.0.0" />
          </dependencies>
      </metadata>
      <files>
           <file src="<TARGET SPECIFIC FILE.DLL>" target="lib" />
           <file src="<TARGET SPECIFIC FILE.PDB>" target="lib" />
           ...
      </files>
    </package>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-05-02
      • 1970-01-01
      • 1970-01-01
      • 2017-03-07
      • 2018-11-23
      相关资源
      最近更新 更多