[英]Could not load file or assembly 'System.ServiceModel, Version=4.0.0.0' exception when starting Stateful Service
I have created a new Service Fabric application in Visual Studio 2017 (version 15.7.1) and added a new service using the .Net Core 2.0 Stateful Service template. 我已在Visual Studio 2017(版本15.7.1)中创建了一个新的Service Fabric应用程序,并使用.Net Core 2.0状态服务模板添加了新服务。
When I try to run the service it fails to start correctly and I can see the following exception in the Diagnostic Events: 当我尝试运行该服务时,它无法正确启动,并且在“诊断事件”中可以看到以下异常:
Description='Replica had multiple failures during open on _Node_0. Description ='Replica在_Node_0上打开期间发生了多次失败。 API call: IStatefulServiceReplica.ChangeRole(P); API调用:IStatefulServiceReplica.ChangeRole(P);
Error = System.IO.FileNotFoundException (-2147024894) Could not load file or assembly 'System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'. 错误= System.IO.FileNotFoundException(-2147024894)无法加载文件或程序集'System.ServiceModel,版本= 4.0.0.0,区域性=中性,PublicKeyToken = b77a5c561934e089'。 The system cannot find the file specified. 该系统找不到指定的文件。
我通过安装Nuget包System.ServiceModel.Primitives修复了此问题:
PM> Install-Package System.ServiceModel.Primitives
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.