warning NU5100: The assembly 'content\lib\subdir\somedll.dll' is not
inside the 'lib' folder and hence it won't be added as a reference
when the package is installed into a project. Move it into the
'lib' folder if it needs to be referenced.
我知道可以通过编写.nuspec
文件来嵌入未管理的DLL(实际上,我已经这样做了)。但是,最新的.csproj
文件格式似乎不需要编写这样的文件。
问题: 我该如何使用.csproj
文件将未管理的DLL嵌入NuGet包中?
- 在
.csproj
文件中指定<ItemGroup><None>
似乎会将文件包含在输出目录中,但它们不会进入NuGet包。 - 在
.csproj
文件中指定<ItemGroup><Content>
将它们添加到NuGet包中,但是放在Content目录而不是Lib目录中。
.csproj
文件和一个.nuspec
文件,最佳实践是将元数据放在哪里?在.csproj
文件中?在.nuspec
文件中?维护和同步两个文件?是否有工具链可以为我完成这项工作?我正在使用Visual Studio Code V1.24和.NET Core/dotnet V2.1。
.nuspec
文件,现在只需要使用一次dotnet build
命令就可以生成构建和NuGet包。 - Steve Kalemkiewicz