Binaries are added to the project when the NuGet package is set to Grpc.Core as a dependency

I have an interesting problem, and now I can not say anything about NuGet, but I create NuGet package, which I'll refer to Project Alpha, which is dependent on Grpcwhich to expand, has a dependency on troublesome package: Grpc.Core.

Grpc.Core, through Grpcinstalls fine in Project Alpha and does not add new files to the Project Alpha project. Project Beta, on the other hand, depends on Project Alpha and the extension Grpc.Core. When I install Project Alpha, the installation Grpc.Corecalls the next project tree in the beta version of the project

ProjectBeta
|- Properties/
|- References/
|- App.config
|- grpc_csharp_ext.x64.dll
|- grpc_csharp_ext.x86.dll
|- libgrpc_csharp_ext.x64.dylib
|- libgrpc_csharp_ext.x64.so
|- libgrpc_csharp_ext.x86.dylib
|- libgrpc_csharp_ext.x86.so
|- packages.config
|- Program.cs

You will notice that it installs 6 binaries that I do not need 1) included in the project, or 2) in the root of the project.

Grpc.Core.nupkg, , 6 runtimes; .targets . , , .

:

-

Project Alpha
|- Grpc
|  |- Grpc.Core
|- Google.Protobuf

nupkg nuget pack ProjectAlpha.csproj -Properties Configuration=Release

content
|- grpc_csharp_ext.x64.dll
|- grpc_csharp_ext.x86.dll
|- libgrpc_csharp_ext.x64.dylib
|- libgrpc_csharp_ext.x64.so
|- libgrpc_csharp_ext.x86.dylib
|- libgrpc_csharp_ext.x86.so
lib
|- net452
   |- ProjectAlpha.dll

, , , content, , . , , " ?". , ; , , .

? ? ?

+4
2

. .nuspec , , NuGet.

, ( ), nuget pack, , -Exclude.

, , .csproj, -

nuget pack ProjectAlpha.csproj -Exclude **\*.x86.*;**\*.x64.*

, nuget pack (bin\Debug bin\Release), - 6 , NuGet , . , .targets Grpc.Core NuGet. , .targets , Grpc.Core. , -Exclude .

, , exclude .nuspec, , !

0

.csproj, Grpc.Core. .nuspec, node, .

, .nuspec nuget, .nuspec , .

<?xml version="1.0"?>
<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
  <metadata>
    <id>MyPackage</id>
    <version>1.0.0</version>
    <title>MyPackage</title>
    <authors>My Name</authors>
    <owners>My Name</owners>
    <requireLicenseAcceptance>false</requireLicenseAcceptance>
    <description>Description</description>
    <copyright>Copyright ?  2017</copyright>
    <dependencies>
      <dependency id="Grpc.Core" version="1.0.1" />
    </dependencies>
  </metadata>

.nuspec .nupkg . 6 .

0

Source: https://habr.com/ru/post/1668284/


All Articles