【发布时间】:2014-06-25 10:02:09
【问题描述】:
在我的简单 ASP.net 网络服务中,我在 2 种情况下收到 NuGet“lib 文件夹外的程序集”警告:
- 对于我的项目中引用的库
- 对于我的主要项目程序集
DLL 确实被打包在 nupkg 文件中(分别在 /content 和 /tools 文件夹中)。
我应该如何配置我的项目?
- 将 2 个 DLL 文件复制到 /lib 文件夹中?
- 将 2 个 DLL 文件从其当前位置移动到 /lib 文件夹中?
- 还有别的吗?
我已经检查了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 项目的默认构建过程会以不合规的方式打包文件。
【问题讨论】:
-
这取决于:) .dll 用于什么用途,是否应该将它们作为程序集引用添加到使用 NuGet 包的项目中? NuGet.org 页面包含有关哪些内容应该放在哪些文件夹中的信息 - docs.nuget.org/docs/creating-packages/…