Protobuf-net 缺少依赖 System.Private.ServiceModel [英] Protobuf-net has missing dependency System.Private.ServiceModel

查看:17
本文介绍了Protobuf-net 缺少依赖 System.Private.ServiceModel的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一个项目,它使用 protobuf-net 来序列化和反序列化我们的 protobuf 消息.它在 Windows 上构建良好,但在我们的 Linux 构建环境中,我们似乎最终缺少一个依赖项.

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.

当 dotnet core 2.1 服务运行时,我们得到一个错误:

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

应用程序依赖项清单中指定的程序集(xxxx.deps.json) 未找到:

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

包:'System.Private.ServiceModel',版本:'4.5.3' 路径:'运行时/unix/lib/netstandard2.0/System.Private.ServiceModel.dll'未定义

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

如何最好地解决这个问题?

How best to solve this?

推荐答案

当前的解决方法是简单地将此库复制到项目构建事件的所需位置

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).nugetpackagessystem.private.servicemodel4.5.3
untimeswinlib
etstandard2.0System.Private.ServiceModel.dll"
          DestinationFolder="$(OutputPath)
untimesunixlib
etstandard2.0" />
  </Target>

还有一个条件仅适用于 Windows 操作系统.

There is also condition that enables only for Windows OS.

这篇关于Protobuf-net 缺少依赖 System.Private.ServiceModel的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆