2

我使用实体框架 CodeFirst 开发了一个 Azure 项目绑定到一个 ASP .NET MVC4 应用程序,当我在本地部署我的 Azure 云服务时它运行良好,但是一旦我在 Azure 上部署它就会抛出一个 SecurityException。您可以在下面看到使用 Intellitrace 的堆栈跟踪图片。我已经在管理模式下运行了我的 Visual Studio,但它仍然失败。

错误

你有什么想法吗?

谢谢。

4

1 回答 1

2

For security purposes Registry access is restricted for ASP.NET Applications. It looks like you are trying to write to the System Event Log.

Before your application can write to the Event Log, you need to create the event source as an administrator. You can do this via EventLog.CreateEventSource(), but this needs to be done as part of an [elevated] role startup task using Powershell.

Web applications don't typically use windows event logging since they are lesser privileged - they often use a tracing subsystem (ETW, etc.) or log to a database or file system directly. A possible alternative to this is to enable tracing via DiagnosticMonitorTraceListener and WAD integration.

于 2013-06-21T19:16:01.513 回答