首页 技术 正文
技术 2022年11月20日
0 收藏 873 点赞 4,200 浏览 3006 个字

未处理System.TypeInitializationException
  HResult=-2146233036
  Message=“System.ServiceModel.Diagnostics.TraceUtility”的类型初始值设定项引发异常。
  Source=System.ServiceModel
  TypeName=System.ServiceModel.Diagnostics.TraceUtility
  StackTrace:
       在 System.ServiceModel.Diagnostics.TraceUtility.SetEtwProviderId()
       在 System.ServiceModel.ServiceHostBase..ctor()
       在 System.ServiceModel.ServiceHost..ctor(Type serviceType, Uri[] baseAddresses)
       在 Wolfy.Server.Program.Main(String[] args) 位置 f:\SUN.TEST\Wolfy.WcfTestClient\Wolfy.Server\Program.cs:行号 16
       在 System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
       在 System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
       在 Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
       在 System.Threading.ThreadHelper.ThreadStart_Context(Object state)
       在 System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       在 System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       在 System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       在 System.Threading.ThreadHelper.ThreadStart()
  InnerException: System.Configuration.ConfigurationErrorsException
       HResult=-2146232062
       Message=配置系统未能初始化
       Source=System.Configuration
       BareMessage=配置系统未能初始化
       Line=0
       StackTrace:
            在 System.Configuration.ConfigurationManager.PrepareConfigSystem()
            在 System.Configuration.ConfigurationManager.GetSection(String sectionName)
            在 System.Configuration.PrivilegedConfigurationManager.GetSection(String sectionName)
            在 System.Diagnostics.DiagnosticsConfiguration.GetConfigSection()
            在 System.Diagnostics.DiagnosticsConfiguration.Initialize()
            在 System.Diagnostics.DiagnosticsConfiguration.get_IndentSize()
            在 System.Diagnostics.TraceInternal.InitializeSettings()
            在 System.Diagnostics.TraceInternal.get_Listeners()
       InnerException: System.Configuration.ConfigurationErrorsException
            HResult=-2146232062
            Message=无法识别的配置节 behaviors。….

Source=System.Configuration
            BareMessage=无法识别的配置节 behaviors。
            Filename=F:\SUN.TEST\Wolfy.WcfTestClient\Wolfy.Server\bin\Debug\Wolfy.Server.vshost.exe.Config
            Line=7
            StackTrace:
                 在 System.Configuration.ConfigurationSchemaErrors.ThrowIfErrors(Boolean ignoreLocal)
                 在 System.Configuration.BaseConfigurationRecord.ThrowIfParseErrors(ConfigurationSchemaErrors schemaErrors)
                 在 System.Configuration.BaseConfigurationRecord.ThrowIfInitErrors()
                 在 System.Configuration.ClientConfigurationSystem.EnsureInit(String configKey)
     ………..

最后解决办法:

出现此错误肯定是配置文件的问题,检查配置文件,是否少了标签。

我这里报这个错误,是因为不想一步一步的写配置文件了,就从之前的项目中复制过来的,由于自己的粗心,发现忘了<system.serviceModel></system.serviceModel> 这对最主要的标签了,这里记录一下,提醒自己不要在这么粗心,这么懒了。

相关推荐
python开发_常用的python模块及安装方法
adodb:我们领导推荐的数据库连接组件bsddb3:BerkeleyDB的连接组件Cheetah-1.0:我比较喜欢这个版本的cheeta…
日期:2022-11-24 点赞:878 阅读:9,083
Educational Codeforces Round 11 C. Hard Process 二分
C. Hard Process题目连接:http://www.codeforces.com/contest/660/problem/CDes…
日期:2022-11-24 点赞:807 阅读:5,558
下载Ubuntn 17.04 内核源代码
zengkefu@server1:/usr/src$ uname -aLinux server1 4.10.0-19-generic #21…
日期:2022-11-24 点赞:569 阅读:6,407
可用Active Desktop Calendar V7.86 注册码序列号
可用Active Desktop Calendar V7.86 注册码序列号Name: www.greendown.cn Code: &nb…
日期:2022-11-24 点赞:733 阅读:6,180
Android调用系统相机、自定义相机、处理大图片
Android调用系统相机和自定义相机实例本博文主要是介绍了android上使用相机进行拍照并显示的两种方式,并且由于涉及到要把拍到的照片显…
日期:2022-11-24 点赞:512 阅读:7,817
Struts的使用
一、Struts2的获取  Struts的官方网站为:http://struts.apache.org/  下载完Struts2的jar包,…
日期:2022-11-24 点赞:671 阅读:4,900