VerificationException only when profiling in LINE mode

Code profiling for .NET developers.

Moderator: dom.smith

VerificationException only when profiling in LINE mode

Postby TheZMan » Tue Oct 15, 2013 10:21 pm

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.
TheZMan
 
Posts: 6
Joined: Tue Oct 15, 2013 9:57 pm

Postby TheZMan » Wed Oct 16, 2013 8:11 pm

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.q ... RIFICATION);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?
TheZMan
 
Posts: 6
Joined: Tue Oct 15, 2013 9:57 pm

Postby TheZMan » Wed Oct 16, 2013 10:27 pm

Solution found..

After googling I came across this which sounded very like my problem
http://documentation.red-gate.com/displ ... arent+code

I removed
[assembly: AllowPartiallyTrustedCallers]
from the gzip source and now line level timing works
TheZMan
 
Posts: 6
Joined: Tue Oct 15, 2013 9:57 pm


Return to ANTS Performance Profiler 8

Who is online

Users browsing this forum: No registered users and 1 guest