豆豆友情提示:这是一个非官方 GitHub 代理镜像,主要用于网络测试或访问加速。请勿在此进行登录、注册或处理任何敏感信息。进行这些操作请务必访问官方网站 github.com。 Raw 内容也通过此代理提供。
Skip to content

Included DLLs inside tools/ folder throw warnings #5020

@ek68794998

Description

@ek68794998

Related issue: #5019

Details about Problem

NuGet product used:
MSBuild v15.1.1012.6693 with Pack target.

NuGet version:
Whatever version is included in VS2017 with the MSBuild version designated above. If this is important, let me know how I can get this version number.

dotnet.exe --version:
N/A

VS version:
15.1 (26403.3)

OS version (i.e. win10 v1607 (14393.321)):
win10 v1703 15165.1002

Worked before? If so, with which NuGet version:
Yes, 4.0.0.2283, when using nuget pack on a nuspec file with the same inclusions (<file src="bin\$configuration$\**\*" target="tools" />).

Detailed repro steps so we can see the same problem

  1. In Visual Studio 2017, create a csproj which produces an executable.
  2. Include a NuGet package and reference it in some way in the code.
  3. Ensure that <TargetFrameworks>net452</TargetFrameworks> is set in the csproj.
  4. Ensure that <IsTool>True</IsTool> is set in the csproj.
  5. Since library references (DLLs from NuGets) required for the project are not included, add:
    <ItemGroup>
    	<None Include="bin\$(Configuration)\**\*.dll">
    		<PackagePath>tools/</PackagePath>
    		<Pack>true</Pack>
    	</None>
    </ItemGroup>
    
  6. Run from VS2017 Developer Command Prompt: msbuild /t:Pack MyProject.csproj

The console will output a bunch of warnings such as:

warning : Description: The assembly 'tools/Newtonsoft.Json.dll' is not inside the 'lib' folder and hence it won't be added as reference when the package is installed into a project.

While, yes, the warning is accurate (unlike in #5019), this is not an issue when packing nuspec files. As mentioned above, using the nuspec block <file src="bin\$configuration$\**\*" target="tools" /> performs the desired behavior without throwing warnings during nuget pack.

Other suggested things

Verbose Logs

https://pastebin.com/cMGs8J1Q

Sample Project

https://drive.google.com/open?id=0B8JHaidj6UhEaTdPSDFfLWM1OVk

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions