Red Gate forums :: View topic - VerificationException only when profiling in LINE mode
Return to www.red-gate.com RSS Feed Available

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

VerificationException only when profiling in LINE mode

Search in ANTS Performance Profiler 8 forum
Post new topic   Reply to topic
Jump to:  
Author Message
TheZMan



Joined: 15 Oct 2013
Posts: 6

PostPosted: Tue Oct 15, 2013 10:21 pm    Post subject: VerificationException only when profiling in LINE mode Reply with quote

I've profiled our game many times with ANTS though it has been using 8.0 so I am not sure if this is related to the 8.3 upgrade or changes we have made.

The game runs perfectly in DEBUG/RELEASE and every other profile we build under. However whenever I try to profile it using ANTS I get a VerificationException the first time I use the Ionic.GZip class.

This class is used throughout our code and I am trying to profile the same DEBUG build that works just fine. So ANTS appears to be the only variable that is changing here.

If I choose method level profiling then the exception doesn't happen. If I choose line level it crashes the app every time.

Any ideas or should I roll back to 8.0 to see if that fixes it?

EDIT: This is an XNA based app using .Net 4.0 in VS 2010.


Last edited by TheZMan on Wed Oct 16, 2013 8:13 pm; edited 2 times in total
Back to top
View user's profile Send private message
TheZMan



Joined: 15 Oct 2013
Posts: 6

PostPosted: Wed Oct 16, 2013 8:11 pm    Post subject: Reply with quote

I rolled back to 7.3 and when line profiling is enabled I get a crash at the same point:


System.Security.VerificationException was unhandled
HResult=-2146233075
Message=Operation could destabilize the runtime.
Source=Ionic.Zip (x86)

After installing 8.3 again I now get the VerificationException instead of the TypeInitializationError - but its in the same line of code. The Constructor for GZipStream.

The Exception Helper asks:
""Make sure your application is not loading two conflicting versions of a class library."
http://msdn.microsoft.com/query/dev10.query?appId=Dev10IDEF1&l=EN-US&k=k(EHVERIFICATION);k(DevLang-CSHARP)&rd=true

There are 2 versions of GZIP in 2 different DLLs. One is private and only used internally so there should not be a conflict and the game runs just fine without the profiler and even with method level timings turned on.

Any ideas what line-level timing is doing to cause this crash?
Back to top
View user's profile Send private message
TheZMan



Joined: 15 Oct 2013
Posts: 6

PostPosted: Wed Oct 16, 2013 10:27 pm    Post subject: Reply with quote

Solution found..

After googling I came across this which sounded very like my problem
http://documentation.red-gate.com/display/APP80/Enabling+line-level+timings+for+SecurityTransparent+code

I removed
[assembly: AllowPartiallyTrustedCallers]
from the gzip source and now line level timing works
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