gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-11-30 13:53:56 24 4
gpt4 key购买 nike

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

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

Description='Replica had multiple failures during open on _Node_0. API call: 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'. The system cannot find the file specified.

最佳答案

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

PM> Install-Package System.ServiceModel.Primitives

关于c# - 启动有状态服务时无法加载文件或程序集 'System.ServiceModel, Version=4.0.0.0' 异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50730878/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com