locked
Getting System.ServiceModel.Diagnostics.DiagnosticTrace..ctor Error RRS feed

  • Question

  • User837465056 posted

    Hi,

    While running any asp.net application whether that is 2.0 or 3.0 application and they are not using WCF, i am getting below error:

    Server Error in '/NGC.Services.Scheduler' Application.

    System.ServiceModel.Diagnostics.DiagnosticTrace..ctor(System.ServiceModel.Diagnostics.TraceSourceKind, System.String, System.String)

    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.MethodAccessException: System.ServiceModel.Diagnostics.DiagnosticTrace..ctor(System.ServiceModel.Diagnostics.TraceSourceKind, System.String, System.String)

    Source Error:

    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

    Stack Trace:

    [MethodAccessException: System.ServiceModel.Diagnostics.DiagnosticTrace..ctor(System.ServiceModel.Diagnostics.TraceSourceKind, System.String, System.String)]
       System.ServiceModel.DiagnosticUtility.InitDiagnosticTraceImpl(TraceSourceKind sourceType, String traceSourceName) +0
       System.ServiceModel.DiagnosticUtility.InitializeTracing() +17
       System.ServiceModel.DiagnosticUtility..cctor() +94
    
    [TypeInitializationException: The type initializer for 'System.ServiceModel.DiagnosticUtility' threw an exception.]
       System.ServiceModel.Configuration.ConfigurationHelpers.UnsafeGetAssociatedSection(ContextInformation evalContext, String sectionPath) +66
       System.ServiceModel.Configuration.ServiceHostingEnvironmentSection.UnsafeGetSection() +25
       System.ServiceModel.HostingManager.LoadConfigParameters() +40
       System.ServiceModel.HostingManager..ctor() +111
       System.ServiceModel.ServiceHostingEnvironment.EnsureInitialized() +141
       System.ServiceModel.ServiceHostingEnvironment.OnEnsureInitialized(Object state) +4
       System.ServiceModel.PartialTrustHelpers.PartialTrustInvoke(ContextCallback callback, Object state) +52
       System.ServiceModel.ServiceHostingEnvironment.SafeEnsureInitialized() +70
       System.ServiceModel.Activation.HttpModule.ProcessRequest(Object sender, EventArgs e) +58
       System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +68
       System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75
    


    Version Information: Microsoft .NET Framework Version:2.0.50727.3053; ASP.NET Version:2.0.50727.3053 <!-- [MethodAccessException]: System.ServiceModel.Diagnostics.DiagnosticTrace..ctor(System.ServiceModel.Diagnostics.TraceSourceKind, System.String, System.String) at System.ServiceModel.DiagnosticUtility.InitDiagnosticTraceImpl(TraceSourceKind sourceType, String traceSourceName) at System.ServiceModel.DiagnosticUtility.InitializeTracing() at System.ServiceModel.DiagnosticUtility..cctor() [TypeInitializationException]: The type initializer for 'System.ServiceModel.DiagnosticUtility' threw an exception. at System.ServiceModel.Configuration.ConfigurationHelpers.UnsafeGetAssociatedSection(ContextInformation evalContext, String sectionPath) at System.ServiceModel.Configuration.ServiceHostingEnvironmentSection.UnsafeGetSection() at System.ServiceModel.ServiceHostingEnvironment.HostingManager.LoadConfigParameters() at System.ServiceModel.ServiceHostingEnvironment.HostingManager..ctor() at System.ServiceModel.ServiceHostingEnvironment.EnsureInitialized() at System.ServiceModel.ServiceHostingEnvironment.OnEnsureInitialized(Object state) at System.ServiceModel.PartialTrustHelpers.PartialTrustInvoke(ContextCallback callback, Object state) at System.ServiceModel.ServiceHostingEnvironment.SafeEnsureInitialized() at System.ServiceModel.Activation.HttpModule.ProcessRequest(Object sender, EventArgs e) at System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) -->

     

     

    I am not understanding what is the problem become if i am running the same URL in another machine, its working fine.

    Please help on this becasue already i spend 3 days and haven't got any success.

     

    Thanks in advance.

    Akash

     

    Tuesday, October 21, 2008 7:42 AM

All replies

  • User355892953 posted

     Are you running the application in partial-trust?

    Tuesday, October 21, 2008 2:24 PM
  • User332351535 posted

    I have the same problem.

    Server Error in '/Web' Application.

    System.ServiceModel.Diagnostics.DiagnosticTrace..ctor(System.ServiceModel.Diagnostics.TraceSourceKind, System.String, System.String)

    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.MethodAccessException: System.ServiceModel.Diagnostics.DiagnosticTrace..ctor(System.ServiceModel.Diagnostics.TraceSourceKind, System.String, System.String)

    Source Error:

    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

    Stack Trace:

    [MethodAccessException: System.ServiceModel.Diagnostics.DiagnosticTrace..ctor(System.ServiceModel.Diagnostics.TraceSourceKind, System.String, System.String)]
       System.ServiceModel.DiagnosticUtility.InitDiagnosticTraceImpl(TraceSourceKind sourceType, String traceSourceName) +0
       System.ServiceModel.DiagnosticUtility.InitializeTracing() +17
       System.ServiceModel.DiagnosticUtility..cctor() +94
    
    [TypeInitializationException: The type initializer for 'System.ServiceModel.DiagnosticUtility' threw an exception.]
       System.ServiceModel.Configuration.ConfigurationHelpers.UnsafeGetAssociatedSection(ContextInformation evalContext, String sectionPath) +66
       System.ServiceModel.Configuration.ServiceHostingEnvironmentSection.UnsafeGetSection() +25
       System.ServiceModel.HostingManager.LoadConfigParameters() +40
       System.ServiceModel.HostingManager..ctor() +111
       System.ServiceModel.ServiceHostingEnvironment.EnsureInitialized() +141
       System.ServiceModel.ServiceHostingEnvironment.OnEnsureInitialized(Object state) +4
       System.ServiceModel.PartialTrustHelpers.PartialTrustInvoke(ContextCallback callback, Object state) +52
       System.ServiceModel.ServiceHostingEnvironment.SafeEnsureInitialized() +70
       System.ServiceModel.Activation.HttpModule.ProcessRequest(Object sender, EventArgs e) +58
       System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +68
       System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75
    


    Version Information: Microsoft .NET Framework Version:2.0.50727.3053; ASP.NET Version:2.0.50727.3053 <!-- [MethodAccessException]: System.ServiceModel.Diagnostics.DiagnosticTrace..ctor(System.ServiceModel.Diagnostics.TraceSourceKind, System.String, System.String) at System.ServiceModel.DiagnosticUtility.InitDiagnosticTraceImpl(TraceSourceKind sourceType, String traceSourceName) at System.ServiceModel.DiagnosticUtility.InitializeTracing() at System.ServiceModel.DiagnosticUtility..cctor() [TypeInitializationException]: The type initializer for 'System.ServiceModel.DiagnosticUtility' threw an exception. at System.ServiceModel.Configuration.ConfigurationHelpers.UnsafeGetAssociatedSection(ContextInformation evalContext, String sectionPath) at System.ServiceModel.Configuration.ServiceHostingEnvironmentSection.UnsafeGetSection() at System.ServiceModel.ServiceHostingEnvironment.HostingManager.LoadConfigParameters() at System.ServiceModel.ServiceHostingEnvironment.HostingManager..ctor() at System.ServiceModel.ServiceHostingEnvironment.EnsureInitialized() at System.ServiceModel.ServiceHostingEnvironment.OnEnsureInitialized(Object state) at System.ServiceModel.PartialTrustHelpers.PartialTrustInvoke(ContextCallback callback, Object state) at System.ServiceModel.ServiceHostingEnvironment.SafeEnsureInitialized() at System.ServiceModel.Activation.HttpModule.ProcessRequest(Object sender, EventArgs e) at System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) -->

    Tuesday, October 21, 2008 10:37 PM
  • User837465056 posted

    Hi,

    What is partial trust? i dont have any idea about it. Previously all the application was running perfect on my machine but suddenly what happen i dont have any idea :-( 

     

    Akash

     

    Wednesday, October 22, 2008 1:01 AM
  • User355892953 posted

     Ok... let's go by parts...

    When this happens? Loading the application, at some part of the application?

    Have you changed the config files?

     

    Wednesday, October 22, 2008 6:02 AM
  • User837465056 posted

    Hi,

    I think this problem related with corruption of framework. I uninstall all the version of .Net and service packs from my machine and install it again then it start working.

    Thanks Agapito for ur help and reply.

     

     

    Wednesday, October 22, 2008 8:25 AM
  • User1239812796 posted

    Server Error in '/WebSite9' Application.

    System.ServiceModel.Diagnostics.DiagnosticTrace..ctor(System.ServiceModel.Diagnostics.TraceSourceKind, System.String, System.String)

    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.MethodAccessException: System.ServiceModel.Diagnostics.DiagnosticTrace..ctor(System.ServiceModel.Diagnostics.TraceSourceKind, System.String, System.String)

    Source Error:

    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

    Stack Trace:

    [MethodAccessException: System.ServiceModel.Diagnostics.DiagnosticTrace..ctor(System.ServiceModel.Diagnostics.TraceSourceKind, System.String, System.String)]
    System.ServiceModel.DiagnosticUtility.InitDiagnosticTraceImpl(TraceSourceKind sourceType, String traceSourceName) +0
    System.ServiceModel.DiagnosticUtility.InitializeTracing() +14
    System.ServiceModel.DiagnosticUtility..cctor() +92

    [TypeInitializationException: The type initializer for 'System.ServiceModel.DiagnosticUtility' threw an exception.]
    System.ServiceModel.Configuration.ConfigurationHelpers.UnsafeGetAssociatedSection(ContextInformation evalContext, String sectionPath) +111
    System.ServiceModel.Configuration.ServiceHostingEnvironmentSection.UnsafeGetSection() +37
    System.ServiceModel.HostingManager.LoadConfigParameters() +32
    System.ServiceModel.HostingManager..ctor() +110
    System.ServiceModel.ServiceHostingEnvironment.EnsureInitialized() +142
    System.ServiceModel.ServiceHostingEnvironment.OnEnsureInitialized(Object state) +4
    System.ServiceModel.PartialTrustHelpers.PartialTrustInvoke(ContextCallback callback, Object state) +52
    System.ServiceModel.Activation.HttpModule.ProcessRequest(Object sender, EventArgs e) +98
    System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +92
    System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +64


    Version Information: Microsoft .NET Framework Version:2.0.50727.1433; ASP.NET Version:2.0.50727.1433

    Saturday, October 24, 2009 10:37 AM