2

我怎样才能弄清楚究竟是什么导致了以下错误?该页面与其他页面相同,但由于某种原因,只有此页面出现此错误。它也只发生在具有中等信任级别的 ISP (GoDaddy) 上,我无法设置断点并尝试捕获它。

Server Error in '/' Application.
Security Exception
Description: The application attempted to perform an operation not allowed by the security policy.  To grant this application the required permission please contact your system administrator or change the application's trust level in the configuration file.

Exception Details: System.Security.SecurityException: Request for the permission of type 'System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.

源错误:

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.
堆栈跟踪:

    [SecurityException:请求'System.Security.Permissions.EnvironmentPermission,mscorlib,Version=2.0.0.0,Culture=neutral,PublicKeyToken=b77a5c561934e089'类型的权限失败。]
       System.Security.CodeAccessSecurityEngine.Check(对象需求, StackCrawlMark& stackMark, Boolean isPermSet) +0
       System.Security.CodeAccessPermission.Demand() +59
       System.IO.Path.GetTempPath() +54
       hh.a(Int32 A_0, 布尔 A_1, 布尔 A_2) +20
       jg.b(c A_0, UInt64 A_1) +234
       ei.b(c A_0, UInt64 A_1) +18
       jg.a(c A_0, UInt64 A_1, 布尔 A_2) +61
    
Version Information: Microsoft .NET Framework Version:2.0.50727.1433; ASP.NET Version:2.0.50727.1433

如果您遇到此问题或只是知道我如何修复或跟踪它,请添加您的答案。ISP 要求中等信任级别。

4

3 回答 3

2

您是否尝试过使用 IIS 的本地实例并将信任级别设置为中等?这将帮助您更快地调试和尝试一些东西。

(And is a good habit to get into anyway. You want to test in an environment as close to production as possible. And the VS web server definitely has a few important differences that can get you if you don't test in IIS too.)

于 2009-05-03T13:21:00.857 回答
1

我不相信 GoDaddy 支持完全信任 - 尽管最近可能发生了变化。该错误是由System.IO.Path.GetTempPath调用引起的,它需要EnvironmentPermission

之前的调用堆栈被混淆了,所以我猜它来自组件供应商。检查更新或修复以获取他们的部分信任,或替换它。

于 2008-11-07T22:33:05.763 回答
0

Setting breakpoints in obfuscated, non-debug assemblies are hard. It will likely lead you nowhere.

Find out why the obfuscated component is trying to access the temp path.

于 2009-07-09T10:25:29.503 回答