在调试服务项目时,其抛出错误{“'system.servicemodel.diagnostics.traceutility的类型初始化程序"引发了异常."} [英] While debugging service project its throwing error {"the type initializer for 'system.servicemodel.diagnostics.traceutility' threw an exception."}
问题描述
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 -------------- <? =" 编码 utf-8" ? < > 应用设置 < > 启动 < ="" sku / < > system.serviceModel < > basicHttpBinding < ="" < ="" / < > 绑定 名称 / < > /bindings < > 端点 地址 ="" bindingConfiguration ="" 名称 / < > /system.serviceModel < > 对此会有一些指导吗?
-----------------------------------------------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屋!