I'm building an ASP.NET MVC 4 application and I recently installed a NuGet package for easing the process of running New Relic through ASP.NET (here's a link to the package on GitHub https://github.com/mikecousins/newrelicazurenuget) but it didn't work. When I uninstalled it, however, my application will no longer work under a Medium trust level.
Here's a stack of the Security Exception I get:
[SecurityException: Request failed.]
System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +161
System.Web.Mvc.Async.<>c__DisplayClass39.<BeginInvokeActionMethodWithFilters>b__33() +120
System.Web.Mvc.Async.<>c__DisplayClass4f.<InvokeActionMethodFilterAsynchronously>b__49() +452
System.Web.Mvc.Async.<>c__DisplayClass37.<BeginInvokeActionMethodWithFilters>b__36(IAsyncResult asyncResult) +15
System.Web.Mvc.Async.<>c__DisplayClass2a.<BeginInvokeAction>b__20() +34
System.Web.Mvc.Async.<>c__DisplayClass25.<BeginInvokeAction>b__22(IAsyncResult asyncResult) +229
System.Web.Mvc.<>c__DisplayClass1d.<BeginExecuteCore>b__18(IAsyncResult asyncResult) +28
System.Web.Mvc.Async.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar) +15
System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult) +53
System.Web.Mvc.Async.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar) +15
System.Web.Mvc.<>c__DisplayClass8.<BeginProcessRequest>b__3(IAsyncResult asyncResult) +42
System.Web.Mvc.Async.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar) +15
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +1694
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +465
I don't know where any of that is coming from, only that the problem didn't exist until I tried to use the package.
Any help on what's causing this and how to fix it would be much appreciated.
Thanks.
EDIT: This only happens when I publish the site to my local IIS and not if I just debug through VS. The trust level is just set in Web.Config. Is there any way to force the trust level while debugging so when this error pops up I might get better code hinting?