SignalR/SignalR — Issue #223: SecurityException when starting (Debug) app right after installing SignalR via Nuget
Author: Comm512
Created: 2012-03-05 09:17:42+00:00
State: open

Hi,

I do not know if this is ths correct place to ask this but i have the following problem
When i run my asp.net mvc 3 app i immidiately get this 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: Request for the permission of type 'System.Security.Permissions.SecurityPermission, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.

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: Request for the permission of type 'System.Security.Permissions.SecurityPermission, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.]
System.Web.Hosting.HostingEnvironment.RegisterObject(IRegisteredObject obj) +24
SignalR.Hosting.AspNet.AspNetShutDownDetector..ctor(Action onShutdown) +55
SignalR.Hosting.AspNet.AspNetBootstrapper..cctor() +113
"

The web.config is adjusted as listed under the faq.

Based on the stacktrace, i would say that it has something to do with the SignalR.Hosting.AspNet lib
When i remove that, the app does start (but nothing works because this is obviously needed)

The project i want to use SignalR in is based on the forum Nearforums. When i create a clean mvc project just to test and install SignalR via nuget in that, i do not encounter this problem.
I have asked this at Nearforum and it did not ring a bell with the developers.

How can i determine what setting is making it give this exception?