因此,我使用 Visual Studio 中的 AWS Toolkit Extension 通过 AWS Elastic Beanstalk(附加了一个 AWS RDS 实例)部署我的网站。我的网络应用程序同时使用 sensenet 服务和 sensenet 网页组件。sensenet 服务是必需的组件,必须存在才能使用其他 sensenet 组件。sensnet 网页组件为用户提供了一个管理 GUI,这是每当有人访问该站点时都会显示的内容。
我的问题是每次访问我的网站时都会发生此安全异常(通过 localhost 运行时不会出现此问题)。
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: The source was not found, but some or all event logs could not be searched. Inaccessible logs: Security.
Source Error:
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.
Stack Trace:
[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) +441
System.Diagnostics.EventLog.SourceExists(String source, String machineName, Boolean wantToCreate) +125
System.Diagnostics.EventLog.SourceExists(String source) +23
SenseNet.Diagnostics.SnEventLogger..ctor(String logName, String logSourceName) +71
SenseNet.Configuration.<>c.<.ctor>b__153_0() in E:\BuildAgent\_work\63\s\src\Storage\Configuration\Providers.cs:83
System.Lazy`1.CreateValue() +708
System.Lazy`1.LazyInitValue() +184
SenseNet.ContentRepository.RepositoryInstance.InitializeLogger() in E:\BuildAgent\_work\63\s\src\ContentRepository\RepositoryInstance.cs:350
SenseNet.ContentRepository.RepositoryInstance.DoStart() in E:\BuildAgent\_work\63\s\src\ContentRepository\RepositoryInstance.cs:130
SenseNet.ContentRepository.RepositoryInstance.Start(RepositoryStartSettings settings) in E:\BuildAgent\_work\63\s\src\ContentRepository\RepositoryInstance.cs:107
SenseNet.ContentRepository.Repository.Start(RepositoryStartSettings settings) in E:\BuildAgent\_work\63\s\src\ContentRepository\Repository.cs:55
SenseNet.Services.SenseNetGlobal.Application_Start(Object sender, EventArgs e, HttpApplication application) in E:\BuildAgent\_work\63\s\src\Services\SenseNetGlobal.cs:156
DERContentRepository.MvcApplication.Application_Start(Object sender, EventArgs e, HttpApplication application) in Global.asax.cs:12
SenseNet.Portal.Global.Application_Start(Object sender, EventArgs e) in E:\BuildAgent\_work\63\s\src\Services\Global.cs:16
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.7.3163.0
我读过的几篇类似这样的stackoverflow帖子
写入事件日志时出现 System.Security.SecurityException
未找到源,但无法搜索部分或全部事件日志。无法访问的日志:安全性
谈到以管理员身份运行 Visual Studio(这不起作用)并使用应用程序的名称创建一个注册表项。最后一种方法我很确定它可以在开发中使用,但不确定它在部署时是否可以使用。部署网站时如何处理这个问题的任何想法?
IIS Express 10
ASP.NET MVC v4.6.2
视窗服务器 2016 v1.2.0