【问题标题】:NuGet "assembly outside lib folder" - ASP.NET - copy or move the file?NuGet“lib文件夹外的程序集” - ASP.NET - 复制或移动文件?
【发布时间】:2014-06-25 10:02:09
【问题描述】:

在我的简单 ASP.net 网络服务中,我在 2 种情况下收到 NuGet“lib 文件夹外的程序集”警告:

  1. 对于我的项目中引用的库
  2. 对于我的主要项目程序集

DLL 确实被打包在 nupkg 文件中(分别在 /content 和 /tools 文件夹中)。

我应该如何配置我的项目?

  1. 将 2 个 DLL 文件复制到 /lib 文件夹中?
  2. 将 2 个 DLL 文件从其当前位置移动到 /lib 文件夹中?
  3. 还有别的吗?

我已经检查了nuget-assembly-outside-lib-folder 问题的答案。

在下面构建转储

我的项目警告中引用的库:

[10:20:34][pack] Issue: Assembly outside lib folder.
[10:20:34][pack] Description: The assembly 'content\(referenced library).dll' is not inside the 'lib' folder and hence it won't be added as reference when the package is installed into a project.
[10:20:34][pack] Solution: Move it into the 'lib' folder if it should be referenced.

主项目组装警告:

[10:20:34][pack] Issue: Assembly outside lib folder.
[10:20:34][pack] Description: The assembly 'tools\(my assembly).dll' is not inside the 'lib' folder and hence it won't be added as reference when the package is installed into a project.
[10:20:34][pack] Solution: Move it into the 'lib' folder if it should be referenced.

我觉得奇怪的是,当 .nuspec 文件未被篡改时,简单 ASP.NET 项目的默认构建过程会以不合规的方式打包文件。

【问题讨论】:

标签: asp.net nuget


【解决方案1】:

我也添加了对引用问题的答案,但是您可以让构建服务器在普通文件夹中构建 .dll 文件,然后对 .csproj 文件而不是 .nuspec 文件使用 nuget pack。它将获取 .nuspec 文件中的信息,但似乎在 .csproj 文件的帮助下可以更好地找到程序集。比如:

nuget pack simple.csproj -IncludeReferencedProjects

【讨论】:

    猜你喜欢
    • 2012-08-05
    • 1970-01-01
    • 1970-01-01
    • 2015-03-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-05-06
    • 1970-01-01
    相关资源
    最近更新 更多