Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/.net/21.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 我得到;“库文件夹外的程序集”;当程序集实际位于库中时发出警告_C#_.net_Nuget - Fatal编程技术网

C# 我得到;“库文件夹外的程序集”;当程序集实际位于库中时发出警告

C# 我得到;“库文件夹外的程序集”;当程序集实际位于库中时发出警告,c#,.net,nuget,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: Iss

下面是我得到的错误:

>./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.
以下是我所使用的include:

<?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>

MyAssembly
0.0.0
波马
MyAssembly
我用NuGet浏览器检查过,dll确实在lib/net46中。这里可能出了什么问题


更新:这发生在NuGet 3.5和4.1上,但不会发生在3.4上,正如George所说,在目标中使用反斜杠
\
而不是正斜杠
/
,警告应该会消失(用NuGet
4.3.0.440
复制)。

我尝试了\而不是正斜杠/

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


尝试将其移动到“lib”而不是“lib/net46”,在这种情况下,我会得到“dll不在框架文件夹中”错误。我没有发现使用
/
\
之间的区别,但从
文件
部分使用
\
。您是否尝试使用反斜杠设置路径?
sudo nuget update -self

Checking for updates from https://www.nuget.org/api/v2/.
Currently running NuGet.exe 4.3.0.
Updating NuGet.exe to 4.7.1.
Update successful.