Include WinSCP with PackageReference copies .exe in MY package
Hi all
I have a problem with the
I reference WinSCP in my project as follows:
After packing my NuGet package, the
But I don't know how I can exclude the
I tried this:
This works for the first/lowest package, the .exe isn't copied and the reference is set in
But for higher packages, which reference MY package (with reference WinSCP in
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:
But I don't think, that is the intended way..
Thanks for any help.
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" />
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>
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>
Thanks for any help.