在调试服务项目时,其抛出错误{“'system.servicemodel.diagnostics.traceutility的类型初始化程序"引发了异常."} [英] While debugging service project its throwing error {"the type initializer for 'system.servicemodel.diagnostics.traceutility' threw an exception."}

查看:479
本文介绍了在调试服务项目时,其抛出错误{“'system.servicemodel.diagnostics.traceutility的类型初始化程序"引发了异常."}的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

I am getting this error while debugging windows .its perfectly working as i run .net windows application .   "The type initializer for 'System.ServiceModel.Diagnostics.TraceUtility' threw an exception." While calling soap client web service " . Code gets above error when it reached to code  

ServiceReference1.WebservicesSoapClient srv = new ServiceReference1.WebservicesSoapClient();

- - - - - - - - - - - - - - - - - - - - - - - -这是我的app.config -------------- <? =" 编码

-----------------------------------------------This is my app.config-------------- <?xml version="1.0" encoding="utf-8" ?><configuration><appsettings></appsettings><startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" /></startup><system.serviceModel><bindings><basicHttpBinding><binding name="WebservicesSoap"><security mode="Transport" /></binding><binding name="WebservicesSoap1" /></basicHttpBinding></bindings><client><endpoint address="https://abc/v2/webservices.asmx" binding="basicHttpBinding" bindingConfiguration="WebservicesSoap" contract="ServiceReference1.WebservicesSoap" name="WebservicesSoap" /></client></system.serviceModel></configuration>   Would some body guid on this ?

推荐答案

TypeInitializationException应该具有InnerException.内部异常的Message和StackTrace是什么?

The TypeInitializationException should have an InnerException. What are the Message and StackTrace of the inner exception?


这篇关于在调试服务项目时,其抛出错误{“'system.servicemodel.diagnostics.traceutility的类型初始化程序"引发了异常."}的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆