The type initializer for "System.Transactions.Diagnostics.DiagnosticTrace" throws an exception
System.TypeInitializationException not processed
hresult=-2146233036
The type initializer for message= "System.ServiceModel.Diagnostics.TraceUtility" throws an exception.
Source=system.servicemodel
Typename=system.servicemodel.diagnostics.traceutility
StackTrace:
In System.ServiceModel.Diagnostics.TraceUtility.SetEtwProviderId ()
In System.ServiceModel.ServiceHostBase. ctor ()
In System.ServiceModel.ServiceHost. ctor (Type servicetype, uri[] baseaddresses)
In Wolfy.Server.Program.Main (string[] args) position F:\SUN. Test\wolfy.wcftestclient\wolfy.server\program.cs: Line No. 16
In system.appdomain._nexecuteassembly (runtimeassembly Assembly, string[] args)
In System.AppDomain.ExecuteAssembly (String assemblyfile, Evidence assemblysecurity, string[] args)
In Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly ()
In System.Threading.ThreadHelper.ThreadStart_Context (Object state)
In System.Threading.ExecutionContext.RunInternal (ExecutionContext ExecutionContext, ContextCallback callback, Object State, Boolean Preservesyncctx)
In System.Threading.ExecutionContext.Run (ExecutionContext ExecutionContext, ContextCallback callback, Object State, Boolean preservesyncctx)
In System.Threading.ExecutionContext.Run (ExecutionContext ExecutionContext, ContextCallback callback, Object State)
In System.Threading.ThreadHelper.ThreadStart ()
InnerException:System.Configuration.ConfigurationErrorsException
hresult=-2146232062
Message= configuration system failed to initialize
Source=system.configuration
Baremessage= configuration system failed to initialize
Line=0
StackTrace:
In System.Configuration.ConfigurationManager.PrepareConfigSystem ()
In System.Configuration.ConfigurationManager.GetSection (String sectionname)
In System.Configuration.PrivilegedConfigurationManager.GetSection (String sectionname)
In System.Diagnostics.DiagnosticsConfiguration.GetConfigSection ()
In System.Diagnostics.DiagnosticsConfiguration.Initialize ()
In System.Diagnostics.DiagnosticsConfiguration.get_IndentSize ()
In System.Diagnostics.TraceInternal.InitializeSettings ()
In System.Diagnostics.TraceInternal.get_Listeners ()
InnerException:System.Configuration.ConfigurationErrorsException
hresult=-2146232062
Message= The unrecognized configuration section behaviors. ....
Source=system.configuration
Baremessage= The unrecognized configuration section behaviors.
Filename=f:\sun. Test\wolfy.wcftestclient\wolfy.server\bin\debug\wolfy.server.vshost.exe.config
Line=7
StackTrace:
In System.Configuration.ConfigurationSchemaErrors.ThrowIfErrors (Boolean ignorelocal)
In System.Configuration.BaseConfigurationRecord.ThrowIfParseErrors (Configurationschemaerrors schemaerrors)
In System.Configuration.BaseConfigurationRecord.ThrowIfInitErrors ()
In System.Configuration.ClientConfigurationSystem.EnsureInit (String configkey)
...........
Final Solution:
This error must be a problem with the profile, check the profile, and see if there are fewer labels.
I reported this error here, because I do not want to write a step-by-step configuration file, from the previous project copied over, due to their carelessness, found that forget <system.serviceModel></system.serviceModel> This is the main label, here to record, remind yourself not to be so careless, so lazy.
Author: wolfy
Source: http://www.cnblogs.com/wolf-sun/
See more highlights of this column: http://www.bianceng.cnhttp://www.bianceng.cn/Programming/net/