我有一个关于在 SF 服务中引发异常的问题——我在反序列化放置在同一集群中的其他远程服务上的异常时遇到了问题(但来自其他解决方案的其他服务类型)。我尝试抛出自定义异常并且在反序列化时遇到问题并切换到使用来自原始异常的消息来抛出简单的异常类型,但是在客户端从源服务中查找库时仍然失败。我不知道为什么在抛出简单异常时远程服务正在寻找这个库。当没有异常调用远程服务时工作正常。
我正在使用此链接中的解决方案https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-reliable-services-communication-remoting
IMyService helloWorldClient = ServiceProxy.Create<IMyService>(new Uri("fabric:/MyApplication/MyHelloWorldService"));
string message = await helloWorldClient.Test("", "", DateTime.Now);
public interface IMyService : IService
{
Task Test(string arg, string arg2, DateTime date);
}
我得到了这个:
Failed to deserialize and get remote exception System.IO.FileNotFoundException: Could not load file or assembly 'XXX.ServiceFabricCommon, Version=6.60.3.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified. File name: 'XXX.ServiceFabricCommon, Version=6.60.3.0, Culture=neutral, PublicKeyToken=null' at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)…