这是我得到的错误:

>./NuGet.exe pack MyAssembly.nuspec
Attempting to build package from 'MyAssembly.nuspec'.
Successfully created package 'V:\...\MyAssembly\bin\Publish\MyAssembly.0.0.0.nupkg'.
WARNING: Issue found with package 'MyAssembly'.

WARNING: Issue: Assembly outside lib folder.
WARNING: Description: The assembly 'lib/net46/MyAssembly.dll' is not inside the 'lib' folder and hence it won't be added as reference when the package is installed into a project.
WARNING: Solution: Move it into the 'lib' folder if it should be referenced.


这包括我使用的内容:

<?xml version="1.0" encoding="utf-8"?>
<package>
  <metadata>
    <id>MyAssembly</id>
    <version>0.0.0</version>
    <authors>Poma</authors>
    <description>MyAssembly</description>
  </metadata>
  <files>
    <file src="MyAssembly.dll" target="lib/net46/" />
  </files>
</package>


我用NuGet Explorer检查过,dll确实在lib / net46中。这有什么问题吗?

更新:NuGet 3.5和4.1会发生这种情况,而3.4不会发生

最佳答案

正如George所说,在目标中使用反斜杠\而不是正斜杠/,警告应该消失(与nuget 4.3.0.440相同)。

09-11 17:47