WCF exception issue

Source: Internet
Author: User

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/

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.