Red Gate forums :: View topic - Exception -> Operation could destabilize the runtime
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
ANTS Performance Profiler 6
ANTS Performance Profiler 6 forum

Exception -> Operation could destabilize the runtime

Search in ANTS Performance Profiler 6 forum
Post new topic   Reply to topic
Jump to:  
Author Message
cjlotz



Joined: 08 Aug 2009
Posts: 40
Location: Cape Town, South Africa

PostPosted: Sun Jul 11, 2010 12:17 am    Post subject: Exception -> Operation could destabilize the runtime Reply with quote

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:

Quote:

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: D:\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 D:\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:

Code:

"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
Back to top
View user's profile Send private message
slaphead99



Joined: 10 Mar 2010
Posts: 93

PostPosted: Mon Jul 12, 2010 11:52 am    Post subject: Reply with quote

Yes- we'll get to the bottom of this one quickly, I'm sure. Were you able to send off an exception report to us? (If the dialog came up automatically).
Back to top
View user's profile Send private message
cjlotz



Joined: 08 Aug 2009
Posts: 40
Location: Cape Town, South Africa

PostPosted: Mon Jul 12, 2010 1:18 pm    Post subject: Reply with quote

Remember this only happens when running the profiler in command line mode and I get not exception dialog box popping up. Had a look in the log folder and the command line profiler didn't seem to write out anything there either. What additional info can I provide?
Back to top
View user's profile Send private message
slaphead99



Joined: 10 Mar 2010
Posts: 93

PostPosted: Mon Jul 12, 2010 7:46 pm    Post subject: Reply with quote

Could you get a mini-dump please and we'll analyze that here.
Back to top
View user's profile Send private message
cjlotz



Joined: 08 Aug 2009
Posts: 40
Location: Cape Town, South Africa

PostPosted: Tue Jul 13, 2010 5:32 am    Post subject: Reply with quote

Is there a link to an article somewhere that describes the process of creating a mini-dump?
Back to top
View user's profile Send private message
AndrewH



Joined: 17 Aug 2006
Posts: 137

PostPosted: Tue Jul 13, 2010 10:40 am    Post subject: Reply with quote

This error generally happens because the line-level timings won't work when applied to partially trusted code. You can try adding an option to the command line parameters to turn this feature off, or you could temporarily change the assembly that's throwing the exception to be full-trust for profiling.

We're considering alternative ways of achieving the line-level support that will avoid this particular problem for v7.
_________________
Andrew Hunter
Software Developer
Red Gate Software Ltd.
Back to top
View user's profile Send private message
cjlotz



Joined: 08 Aug 2009
Posts: 40
Location: Cape Town, South Africa

PostPosted: Tue Jul 13, 2010 12:25 pm    Post subject: Reply with quote

Andrew

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?
Back to top
View user's profile Send private message
Brian Donahue



Joined: 23 Aug 2004
Posts: 6669

PostPosted: Thu May 12, 2011 10:26 am    Post subject: Reply with quote

It happens in the UI as well as the command-line. The settings must be different regarding the line-level timings.

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.
Back to top
View user's profile Send private message
mhanrahan



Joined: 16 Jun 2011
Posts: 5

PostPosted: Sat Jan 28, 2012 7:07 pm    Post subject: NInject with ANTS Profiler Reply with quote

When profiling an app that uses NInject I am getting an error that says "Operation could destabilize the runtime" if I use line level timings. As I have no control over this assembly I can't remove the security attributes. Is there any solution you could suggest to remedy this?

Thanks,

Mike.
_________________
Mike Hanrahan
Back to top
View user's profile Send private message
Brian Donahue



Joined: 23 Aug 2004
Posts: 6669

PostPosted: Mon Jan 30, 2012 10:03 am    Post subject: Reply with quote

Did you try setting web.config to Full Trust?
http://www.red-gate.com/supportcenter/content/knowledgebase/ANTS_Performance_Profiler/KB200903000361
Back to top
View user's profile Send private message
mhanrahan



Joined: 16 Jun 2011
Posts: 5

PostPosted: Mon Jan 30, 2012 3:49 pm    Post subject: NInject Issue Resolved Reply with quote

I was able to solve it by removing the NInject .pdb files and setting ANTS to only profile where code is available. Not ideal, but it will work until NInject remove the security policies that are causing this. Thanks.
_________________
Mike Hanrahan
Back to top
View user's profile Send private message
jessica.ramos



Joined: 23 Apr 2012
Posts: 224

PostPosted: Fri Jun 29, 2012 11:26 pm    Post subject: Reply with quote

Another customer was able to resolve this issue by adding

[assembly: System.Security.SecurityRules(System.Security.SecurityRuleSet.Level1)]

to the assembly.cs file of the offending assemblies.
_________________
Jessica Ramos
Technical Support
Red Gate Software Ltd.
Back to top
View user's profile Send private message
martinh_kentico



Joined: 21 Feb 2013
Posts: 1

PostPosted: Thu Feb 21, 2013 7:05 pm    Post subject: Reply with quote

Hi, I can confirm that this helped also in our project:

[assembly: System.Security.SecurityRules(System.Security.SecurityRuleSet.Level1)]
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group