0

We have a project that uses protobuf-net for serialising and deserialising our protobuf messages. It builds fine on windows, but on our Linux build environment we seem to end up missing a dependency.

When the dotnet core 2.1 service runs up we get an error of:

An assembly specified in the application dependencies manifest (xxxx.deps.json) was not found:

package: 'System.Private.ServiceModel', version: '4.5.3' path: 'runtimes/unix/lib/netstandard2.0/System.Private.ServiceModel.dll' undefined

How best to solve this?

Simply Ged
  • 8,250
  • 11
  • 32
  • 40
Russell Troywest
  • 8,635
  • 3
  • 35
  • 40

1 Answers1

0

Current workaround is to simply copy this library to desired location on project build event

  <Target Name="BuildProces" BeforeTargets="Build">
    <Copy Condition=" '$(OS)' == 'Windows_NT' "  
          SourceFiles="$(USERPROFILE)\.nuget\packages\system.private.servicemodel\4.5.3\runtimes\win\lib\netstandard2.0\System.Private.ServiceModel.dll"
          DestinationFolder="$(OutputPath)\runtimes\unix\lib\netstandard2.0\" />
  </Target>

There is also condition that enables only for Windows OS.

Pavlo Neiman
  • 7,438
  • 3
  • 28
  • 28