【问题标题】:Server Error in '/' Application ()“/”应用程序中的服务器错误()
【发布时间】: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


【解决方案1】:

移除绑定(Team Foundation Service - tfs)的过程很简单:

确保您没有在 Visual Studio 中打开解决方案/项目 将您的解决方案复制到新目录(因为该工具会修改文件)

从命令行运行实用程序:VSUnbindSourceControl.exe d:\mysolution folder

工具完成后,所有源代码管理绑定都已从任何解决方案和项目文件中删除。

也可以看看this SO post

【讨论】:

    猜你喜欢
    • 2017-09-18
    • 1970-01-01
    • 1970-01-01
    • 2014-10-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多