Tag: visual web developer 2010

System.MethodAccessException:尝试通过安全透明方法访问安全性关键方法在所有应用程序上失败

您好,并提前感谢您的帮助,我知道这个问题或类似的问题已经发布,经常与MVC 3应用程序有关。 但是,每当我尝试使用.net 4.0目标框架从visual web developer express 2010中启动任何应用程序时,我都会收到此错误消息。 确切的错误消息是: 尝试使用安全透明方法’System.Runtime.Diagnostics.DiagnosticTrace..ctor(System.String,System.Guid)’来访问安全关键方法’System.Runtime.Diagnostics.EtwDiagnosticTrace..ctor(System.String,System.Guid) )’失败’。 程序集“System.ServiceModel.Internals,Version = 4.0.0.0,Culture = neutral,PublicKeyToken = 31bf3856ad364e35”标有AllowPartiallyTrustedCallersAttribute,并使用2级安全透明度模型。 2级透明度导致AllowPartiallyTrustedCallers程序集中的所有方法默认情况下变为透明,这可能是此exception的原因。 堆栈跟踪: [MethodAccessException: Attempt by security transparent method ‘System.Runtime.Diagnostics.DiagnosticTrace..ctor(System.String, System.Guid)’ to access security critical method ‘System.Runtime.Diagnostics.EtwDiagnosticTrace..ctor(System.String, System.Guid)’ failed. Assembly ‘System.ServiceModel.Internals, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35’ is marked with the AllowPartiallyTrustedCallersAttribute, and uses the level 2 security transparency model. Level […]