C# hangs on "Managed to native Transition" when there is no such transition
I recently upgraded my main dev machine to Win 7, Visual Studio 2010, .NET 4, and XNA 4.0. I had to port a bunch of my XNA code, as there were breaking changes from 3.1-> 4.
Everything in my solution compiles now, but I am getting really strange hangs at odd times. I've tried with several projects, and the symptom is that it will consistently hang on some method call, and the stack trace will show the top of the stack as being "Managed to Native Transition". This is very strange, as these are very simple method calls in managed code. A simplified example is as follows:
public class ShadowWindows: Game {
// other methods
protected override void Initialize() {
//bunch of initialization
InitMod开发者_如何学JAVAels();
InitRenderer();
}
protected void InitModels() {
//do a bunch of stuff
}
}
The above code hangs on the "InitModels()" call. If I use the debugger I can't step into the method, it will just hang if I try to do so.
Any ideas? It's almost as if there's some sort of corruption going on. The problem doesn't seem ratioanl to me.
Thanks, Garth
精彩评论