Quantcast
Channel: Active questions tagged nuget-package - Stack Overflow
Viewing all articles
Browse latest Browse all 3067

Including WinSCP with PackageReference copies Winscp.exe in MY package

$
0
0

I have a problem with the WinSCP.exe file in my created NuGet package.I reference WinSCP in my project as follows:

<PackageReference Include="WinSCP" version="5.17.10" />

After packing my NuGet package, the winscp.exe is copied to the package in contentFiles. When I reference my package in other projects/NuGet packages, the winscp.exe is also copied into the package. I don't like that, because I want to use the references and download it while package restore (obviously).

But I don't know how I can exclude the .exe from my package.

I tried this:

<PackageReference Include="WinSCP" version="5.17.10" ><PrivateAssets>none</PrivateAssets><IncludeAssets>all</IncludeAssets><ExcludeAssets>contentFiles;build;runtime;native;analyzers</ExcludeAssets></PackageReference>

This works for the first/lowest package, the .exe isn't copied and the reference is set in nuspec.But for higher packages, which reference MY package (with reference WinSCP in nuspec), the .exe file isn't copied.

One workaround is as far as I can see, that I add for each package which is using my first/lowest package, the same reference again:

<PackageReference Include="WinSCP" version="5.17.10" ><PrivateAssets>none</PrivateAssets><IncludeAssets>all</IncludeAssets><ExcludeAssets>contentFiles;build;runtime;native;analyzers</ExcludeAssets></PackageReference>

But I don't think, that is the intended way..

Thanks for any help.


Viewing all articles
Browse latest Browse all 3067

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>