【问题标题】:Could not load file or assembly 'System.ServiceModel, Version=4.0.0.0' exception when starting Stateful Service启动有状态服务时无法加载文件或程序集“System.ServiceModel,Version=4.0.0.0”异常
【发布时间】:2018-11-16 18:11:26
【问题描述】:

我在 Visual Studio 2017(版本 15.7.1)中创建了一个新的 Service Fabric 应用程序,并使用 .Net Core 2.0 Stateful Service 模板添加了一个新服务。

当我尝试运行服务时,它无法正确启动,并且我可以在诊断事件中看到以下异常:

Description='副本在 _Node_0 上打开期间出现多次故障。 API 调用:IStatefulServiceReplica.ChangeRole(P);

错误 = System.IO.FileNotFoundException (-2147024894) 无法加载文件或程序集“System.ServiceModel,Version=4.0.0.0,Culture=neutral,PublicKeyToken=b77a5c561934e089”。 系统找不到指定的文件。

【问题讨论】:

    标签: c# .net-core azure-service-fabric


    【解决方案1】:

    我通过安装 Nuget 包System.ServiceModel.Primitives解决了这个问题:

    PM> Install-Package System.ServiceModel.Primitives
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2017-11-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-08-03
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多