【发布时间】:2015-06-01 03:53:38
【问题描述】:
我创建了一个 OData ADO.NET Framework web api,我正在 localhost 中测试它并收到错误
Line 19: if (!EventLog.SourceExists("MyService"))
StackTrace 是:
[SecurityException: The source was not found, but some or all event logs could not be searched. Inaccessible logs: Security.]
System.Diagnostics.EventLog.FindSourceRegistration(String source, String machineName, Boolean readOnly, Boolean wantToCreate) +657
System.Diagnostics.EventLog.SourceExists(String source, String machineName, Boolean wantToCreate) +104
System.Diagnostics.EventLog.SourceExists(String source) +14
我应该如何消除这个错误?非常感谢。
我的 web.config 有:
<system.web>
<authentication mode="Windows">
<forms requireSSL="true" />
</authentication>
<authorization>
<allow roles="MyService" />
<deny users="*" />
</authorization>
<httpCookies requireSSL="true" httpOnlyCookies="true" />
<compilation debug="true" targetFramework="4.5" />
<httpRuntime targetFramework="4.5" enableVersionHeader="false"/>
</system.web>
【问题讨论】:
-
@utility 是一个多项目的解决方案。
-
尝试以管理员模式运行
-
您的代码没有权限...阅读这篇文章:problem solved
-
@utility 如何以管理员模式运行?
-
我的意思是在管理员模式下运行 VS
标签: c# .net web-services visual-studio odata