Exception -> Operation could destabilize the runtime
cjlotz
Posts: 45
Hi
I've installed the new ANTS 6 Profiler after using the EAP successfully on and off during the last 2-3 months. We are using the new command line profiling features to get the profiler running in the background. We then use soapUI from the command line as well to create some load against our services. This gives us a sort-of-automated performance test run.
As mentioned, all of this was working at some point-in-time using one of the EAP builds. However, when following the same process using the RTW, we get the following exception:
I've verified that we can successfully profile our application using the ANTS UI, so it seems to be related to profiling from the command line only. The problem also isn't related to soapUI as we use it just to create a load on the server. However, just to verify I also ran the profiler from the command line without using soapUI and got the same exception when browsing to the web site.
We are running directly against IIS and not using Cassini. Here is the command line we use for driving the profiler:
I tried looking in the logs folder, but the command line profiler doesn't seem to create any log entries. Can you please assist.
Thanks
Carel
I've installed the new ANTS 6 Profiler after using the EAP successfully on and off during the last 2-3 months. We are using the new command line profiling features to get the profiler running in the background. We then use soapUI from the command line as well to create some load against our services. This gives us a sort-of-automated performance test run.
As mentioned, all of this was working at some point-in-time using one of the EAP builds. However, when following the same process using the RTW, we get the following exception:
Operation could destabilize the runtime.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Security.VerificationException: Operation could destabilize the runtime.
Source Error:
[No relevant source lines]
Source File: \Projects\VS 2008\ninject.extensions.wcf\source\Ninject.Extensions.Wcf\NinjectWcfApplication.cs Line: 0
Stack Trace:
[VerificationException: Operation could destabilize the runtime.]
Ninject.Extensions.Wcf.NinjectWcfApplication.Application_Start(Object sender, EventArgs e) in \Projects\VS 2008\ninject.extensions.wcf\source\Ninject.Extensions.Wcf\NinjectWcfApplication.cs:0
[HttpException (0x80004005): Operation could destabilize the runtime.]
System.Web.HttpApplicationFactory.EnsureAppStartCalledForIntegratedMode(HttpContext context, HttpApplication app) +587
System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +194
System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +352
System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +405
System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +368
[HttpException (0x80004005): Operation could destabilize the runtime.]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +646
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +141
System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +771
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1
I've verified that we can successfully profile our application using the ANTS UI, so it seems to be related to profiling from the command line only. The problem also isn't related to soapUI as we use it just to create a load on the server. However, just to verify I also ran the profiler from the command line without using soapUI and got the same exception when browsing to the web site.
We are running directly against IIS and not using Cassini. Here is the command line we use for driving the profiler:
"C:\Program Files\Red Gate\ANTS Performance Profiler 6\Profile.exe" /project:"D:\PragmaDev\OK52\pOnKey\Main\Metrics\PerformanceTests\Pragma.OnKey5.app6" /verbose /lineLevel /onlyWithSource /force /timeout:60 /data:"D:\PragmaDev\OK52\pOnKey\Main\Metrics\PerformanceResults\2010_07_11\StaffMember\00_53\StaffMember.app6results" /htmlreport:"D:\PragmaDev\OK52\pOnKey\Main\Metrics\PerformanceResults\2010_07_11\StaffMember\00_53\StaffMember.Summary.html"
I tried looking in the logs folder, but the command line profiler doesn't seem to create any log entries. Can you please assist.
Thanks
Carel
Comments
We're considering alternative ways of achieving the line-level support that will avoid this particular problem for v7.
Software Developer
Red Gate Software Ltd.
I can confirm that I don't get the exception when using the /methodLevel option on the command line. I would ideally like to have the line-level details via die command line profiler as well. Why does this work via the UI though? Shouldn't we hit the same problems?
I have a test case that demonstrates the problem - put a [System.Security.Permissions.SecurityPermission(System.Security.Permissions.SecurityAction.LinkDemand)] attribute on the Page_Load method of an ASPX codebehind file, set Web.Config to trust level="medium", and run it in the 4.0 version of development webserver and you wil see the error.
Change the profiler settings to use the "2.0" version of development webserver and there is no problem. Change web.config to trust level="Full" and there is no problem on either webserver.
The only way to make it work all-round at this time is to go through all methods in the application and take the SecurityPermission attributes off or do Code Access Policy the .NET 4.0 way.
Thanks,
Mike.
http://www.red-gate.com/supportcenter/c ... 0903000361
[assembly: System.Security.SecurityRules(System.Security.SecurityRuleSet.Level1)]
to the assembly.cs file of the offending assemblies.
Jessica Ramos | Product Support Engineer | Redgate Software
Have you visited our Help Center?
[assembly: System.Security.SecurityRules(System.Security.SecurityRuleSet.Level1)]