紧急求援: asp.net程式向系统日志中写入错误信息时, 提示没有权限, 如何解决! 谢谢!!!
cwsj 2003-05-29 04:27:48
“/ElecTrade”应用程序中的服务器错误。
--------------------------------------------------------------------------------
安全性异常
说明: 应用程序试图执行安全策略不允许的操作。要授予此应用程序所需的权限,请与系统管理员联系,或在配置文件中更改该应用程序的信任级别。
异常详细信息: System.Security.SecurityException: 不允许所请求的注册表访问权。
源错误:
行 18: // make sure we have an event log
行 19: if (!(EventLog.SourceExists(EVENT_LOG_SOURCE))) {
行 20: EventLog.CreateEventSource(EVENT_LOG_SOURCE, "Application");
行 21: }
行 22:
源文件: D:\myProject\ElecTrade\Web\Components\Error.cs 行: 20
堆栈跟踪:
[SecurityException: 不允许所请求的注册表访问权。]
Microsoft.Win32.RegistryKey.OpenSubKey(String name, Boolean writable) +473
System.Diagnostics.EventLog.CreateEventSource(String source, String logName, String machineName, Boolean useMutex) +445
System.Diagnostics.EventLog.CreateEventSource(String source, String logName, String machineName) +11
System.Diagnostics.EventLog.CreateEventSource(String source, String logName) +11
ElecTrade.Components.Error.Log(String message) in D:\myProject\ElecTrade\Web\Components\Error.cs:20
ElecTrade.Components.Baskets.Insert(Int32& basketId, Int32 userId, Int32 infoId, Int32 type, String subject, String postDate) in D:\myProject\ElecTrade\Web\Components\Basket.cs:152
ElecTrade.MySMChina.CompanyPage.BasketAddPage.UpdateBasket() in d:\myproject\electrade\web\mysmchina\company\basketadd.aspx.cs:73
ElecTrade.MySMChina.CompanyPage.BasketAddPage.Page_Load(Object sender, EventArgs e) in d:\myproject\electrade\web\mysmchina\company\basketadd.aspx.cs:60
System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +29
System.Web.UI.Page.ProcessRequestMain() +2077
System.Web.UI.Page.ProcessRequest() +117
System.Web.UI.Page.ProcessRequest(HttpContext context) +18
System.Web.CallHandlerExecutionStep.Execute() +179
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +87
--------------------------------------------------------------------------------
版本信息: Microsoft .NET 框架版本:1.0.3705.288; ASP.NET 版本:1.0.3705.288