Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Included DLLs inside tools/ folder throw warnings #5020

Closed
ek68794998 opened this issue Apr 12, 2017 · 3 comments
Closed

Included DLLs inside tools/ folder throw warnings #5020

ek68794998 opened this issue Apr 12, 2017 · 3 comments

Comments

@ek68794998
Copy link

ek68794998 commented Apr 12, 2017

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

@rohit21agrawal
Copy link
Contributor

@ekumlin thanks for the report! for now you can set <NoPackageAnalaysis>true</NoPackageAnalysis> to workaround this warning.

@ek68794998
Copy link
Author

Thanks for the suggestion!

For now we're going to probably just leave the warnings in just so we are alerted if there are other actual warnings.

@rohit21agrawal
Copy link
Contributor

this should be fixed as part of : NuGet/NuGet.Client#1609

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants