当程序集实际上在lib中时,我得到“在lib文件夹外部组装”的警告

时间:2017-07-31 15:10:09

标签: c# .net nuget

这是我得到的错误:

>./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不会发生

2 个答案:

答案 0 :(得分:5)

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

答案 1 :(得分:0)

我尝试使用\而不是正斜杠/都没用。

但是,将Nuget.exe更新到最新版本有效了:)

Frequency_Sys100NS