繁体   English   中英

Mono消耗WCF服务失败ServiceClient Linux

[英]Mono Consume WCF Service Fail ServiceClient Linux

我需要以下异常的帮助。 我正在尝试使用basicHttpSecurity等使用Web WCF Web服务。我查看了Mono的开发管道,正在使用的部分是工作部分。

因此,我尝试使用的服务是AccountService.svc。 生成的代理具有我正在使用的AccountServiceClient()对象。 在创建对象的那一行,它会引发异常,并且无法调试并逐步进入该构造函数。

奇怪的是,我可以通过IIS在Windows计算机上使用此服务。 我也可以使用mod mono扩展程序在Mac PC上使用。 但不是在Ubuntu Linux机器上。 谁能对此有所启发? 谁能解释为什么会这样? 我该如何解决?

我创建一个新的客户端实例。

client = new AccountServiceClient ();

AccountServiceClient()片段

public partial class AccountServiceClient : System.ServiceModel.ClientBase<EServicesAccountProxy.IAccountService>, EServicesAccountProxy.IAccountService

被抛出的异常。

System.Reflection.ReflectionTypeLoadException: The classes in the module cannot be loaded.
at (wrapper managed-to-native) System.Reflection.Assembly:GetTypes (System.Reflection.Assembly,bool)
at System.Reflection.Assembly.GetTypes () [0x00000] in <filename unknown>:0 
at System.ServiceModel.Configuration.ConfigUtil.GetTypeFromConfigString (System.String name, NamedConfigCategory category) [0x00000] in <filename unknown>:0 
at System.ServiceModel.ChannelFactory.ApplyConfiguration (System.String endpointConfig) [0x00000] in <filename unknown>:0 
at System.ServiceModel.ChannelFactory.InitializeEndpoint (System.String endpointConfigurationName, System.ServiceModel.EndpointAddress remoteAddress) [0x00000] in <filename unknown>:0 
at System.ServiceModel.ChannelFactory`1[EServicesAccountProxy.IAccountService]..ctor (System.String endpointConfigurationName, System.ServiceModel.EndpointAddress remoteAddress) [0x00000] in <filename unknown>:0 
at System.ServiceModel.ClientBase`1[EServicesAccountProxy.IAccountService].Initialize (System.ServiceModel.InstanceContext instance, System.String endpointConfigurationName, System.ServiceModel.EndpointAddress remoteAddress) [0x00000] in <filename unknown>:0 
at System.ServiceModel.ClientBase`1[EServicesAccountProxy.IAccountService]..ctor (System.ServiceModel.InstanceContext instance, System.String endpointConfigurationName) [0x00000] in <filename unknown>:0 
at System.ServiceModel.ClientBase`1[EServicesAccountProxy.IAccountService]..ctor (System.ServiceModel.InstanceContext instance) [0x00000] in <filename unknown>:0 
at System.ServiceModel.ClientBase`1[EServicesAccountProxy.IAccountService]..ctor () [0x00000] in <filename unknown>:0 
at EServicesAccountProxy.AccountServiceClient..ctor () [0x00000] in <filename unknown>:0 
at TCShared.TCInsuranceSystem_EGW.GetAccount (TCShared.TCInsuranceSystemAccount objInsuranceSystemAccount) [0x00000] in <filename unknown>:0 

我注意到的一个奇怪的事情是,我也得到了LoaderException(System.TypeLoadException)。 我不知道是否相关,因为该消息说它无法从“ Npgsql.VisualStudio”中加载“ Npgsql.VisualStudio.NpgsqlObjectSelector”类型,vserion = 2.0.2.1,与文化无关,PublicKeyToken = null。 我什至没有使用VisualStudio,而是在Windows计算机上使用了monodevelop和XamarinStudio。

她在异常消息中指出是否来自“ mscorelib”

任何帮助将不胜感激。

原来有一个内部加载异常,我的bin中有一个Npgsql.VisualStudio DLL。 一旦我删除,一切正常。 由于缺少引用,反射无法加载该DLL。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM