简体   繁体   English

启动状态服务时无法加载文件或程序集'System.ServiceModel,Version = 4.0.0.0'异常

[英]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.

相关问题 无法加载文件或程序集'System.ServiceModel.Web,版本= 4.0.0.0' - Could not load file or assembly 'System.ServiceModel.Web, Version=4.0.0.0' 神秘的“无法加载文件或程序集'System.ServiceModel,版本= 4.0.0.0…”错误 - The mysterious “Couldn't not load file or assembly 'System.ServiceModel, Version=4.0.0.0…” error 无法加载文件或程序集'System.Collections,版本= 4.0.0.0 - Could not load file or assembly 'System.Collections, Version=4.0.0.0 无法加载文件或程序集'System.Data.SqlServerCe,Version = 4.0.0.0 - Could not load file or assembly 'System.Data.SqlServerCe, Version=4.0.0.0 无法加载文件或程序集 'System.Web.Services,版本 = 4.0.0.0 - Could not load file or assembly 'System.Web.Services, Version=4.0.0.0 无法加载文件或程序集“ System.Web.MVC,版本4.0.0.0” - could not load file or assembly 'System.Web.MVC, version 4.0.0.0,' 无法加载文件或程序集'System.Drawing,Version = 4.0.0.0 - Could not load file or assembly 'System.Drawing, Version=4.0.0.0 无法加载文件或程序集'System.Private.ServiceModel,版本 = 4.1.2.4 - Could not load file or assembly 'System.Private.ServiceModel, Version=4.1.2.4 无法加载文件或程序集 'Ninject 版本 4.0.0.0 - Could not load file or assembly 'Ninject version 4.0.0.0 无法加载文件或程序集 'MSHTML,版本 = 4.0.0.0, - Could not load file or assembly 'MSHTML, Version=4.0.0.0,
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM