找不到源,但无法使用SignalR

时间:2016-03-30 14:02:00

标签: .net asp.net-mvc asp.net-mvc-4 signalr

我将一个MVC4应用程序(使用SignalR)部署到服务器。 SignalR在我的dev机器上运行时工作正常,但是当我将它部署到服务器后运行它时出现以下错误。我认为这与没有权限写入事件日志的事情有关。我看了this回答,但这些解决方案对我不起作用。有人可以解释一下吗?

  

System.Security.SecurityException:找不到源,但无法搜索部分或全部事件日志。要创建源,您需要具有读取所有事件日志的权限,以确保新源名称是唯一的。无法访问的日志:安全性。

     

服务器堆栈跟踪:at   System.Diagnostics.EventLog.FindSourceRegistration(String source,   String machineName,Boolean readOnly,Boolean wantToCreate)at   System.Diagnostics.EventLog.SourceExists(String source,String   machineName,Boolean wantToCreate)at   System.Diagnostics.EventLogInternal.VerifyAndCreateSource(字符串   sourceName,String currentMachineName)at   System.Diagnostics.EventLogInternal.WriteEvent(EventInstance实例,   字节[]数据,对象[]值)   System.Diagnostics.EventLog.WriteEvent(EventInstance实例,   对象[]值)在   System.Diagnostics.TraceSource.TraceEvent(TraceEventType eventType,   Int32 id,String format,Object [] args)at   Microsoft.AspNet.SignalR.Transports.TransportHeartbeat<> c__DisplayClass2.b__1(字符串   key,ConnectionMetadata old)at   System.Collections.Concurrent.ConcurrentDictionary 2.AddOrUpdate(TKey key, TValue addValue, Func 3 updateValueFactory)at at   Microsoft.AspNet.SignalR.Transports.TransportHeartbeat.AddConnection(ITrackingConnection   连接)   Microsoft.AspNet.SignalR.Transports.ForeverTransport.ProcessReceiveRequest(ITransportConnection   连接)   Microsoft.AspNet.SignalR.PersistentConnection.ProcessRequest(HostContext   在Microsoft.Owin.Host.SystemWeb.OwinCallContext.Execute()上下文   在   Microsoft.Owin.Host.SystemWeb.OwinHttpHandler.BeginProcessRequest(HttpContextBase   httpContext,AsyncCallback回调,Object extraData)

     

在[0]处重新抛出异常:at   Microsoft.Owin.Host.SystemWeb.Infrastructure.ErrorState<> c__DisplayClass1.b__0(例外   ex)at   Microsoft.Owin.Host.SystemWeb.CallContextAsyncResult.End(IAsyncResult的   结果)在   System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()   在System.Web.HttpApplication.ExecuteStep(IExecutionStep步骤,   布尔和放大器; completedSynchronously)失败的程序集区域   是:MyComputer

2 个答案:

答案 0 :(得分:1)

为了进行测试,您可以将管理员用户设置为应用程序池的标识。 默认情况下,该值为ApplicationPoolIdentity

enter image description here

如果有效,您应该为Network Service添加权限,并将其添加为应用池的用户。您应该在此注册表项上为此用户添加权限: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\Security

答案 1 :(得分:0)

另一个解决方法是以管理员身份运行Visual Studio。

相关问题