Visual Studio 2012 RC Throwing Exception When trying to use IntelliTrace with Call Information in a Migrated Project

StackOverflow https://stackoverflow.com/questions/11090331

Question

I installed Visual Studio 2012 Ultimate RC this morning after learning about IntelliTrace at TechEd last week. We currently use VS 2010 Professional, so using the 2012 RC was my only easy option for testing out IntelliTrace.

I opened up VS 2012 Ultimate RC and opened a MVC 3 project that was written in VS 2010. IntelliTrace runs fine if I have it set to "IntelliTrace events only". If I set it to "IntelliTrace events and call information" however, I get an exception when starting the debugger:

System.Reflection.TargetInvocationException was unhandled
HResult=-2146232828
Message=Exception has been thrown by the target of an invocation.
Source=mscorlib
StackTrace:
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
   at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
   at System.Web.HttpApplication.InvokeMethodWithAssert(MethodInfo method, Int32 paramCount, Object eventSource, EventArgs eventArgs)
   at System.Web.HttpApplication.ProcessSpecialRequest(HttpContext context, MethodInfo method, Int32 paramCount, Object eventSource, EventArgs eventArgs, HttpSessionState session)
   at System.Web.HttpApplicationFactory.FireApplicationOnStart(HttpContext context)
   at System.Web.HttpApplicationFactory.EnsureAppStartCalled(HttpContext context)
   at System.Web.HttpApplicationFactory.GetApplicationInstance(HttpContext context)
   at System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr)
   at System.Web.HttpRuntime.ProcessRequestNow(HttpWorkerRequest wr)
   at System.Web.HttpRuntime.ProcessRequestNoDemand(HttpWorkerRequest wr)
   at System.Web.HttpRuntime.ProcessRequest(HttpWorkerRequest wr)
   at Microsoft.VisualStudio.WebHost.Request.Process()
   at Microsoft.VisualStudio.WebHost.Host.ProcessRequest(Connection conn)
   at Microsoft.VisualStudio.WebHost.Host.ProcessRequest(Connection conn)
   at Microsoft.VisualStudio.WebHost.Server.OnSocketAccept(Object acceptedSocket)
   at System.Threading.QueueUserWorkItemCallback.WaitCallback_Context(Object state)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
   at System.Threading.ThreadPoolWorkQueue.Dispatch()
   at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()
InnerException: System.AccessViolationException
   HResult=-2147467261
   Message=Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
   StackTrace:
   InnerException: 

The problem seems to be somewhere in the function entry to Microsoft.VisualStudio.WebHost.Server.OnSocketAccept. I have no idea what this is though.

I played around some and found that:

  • The problem doesn't occur if I open a web forms project that was created in VS 2010.
  • The problem doesn't occur if I create a new MVC 3 project in VS 2012 RC.
  • The problem only occurs if I open a MVC 3 project that was created in VS 2010.

I'm stumped as to how to try and fix this other than creating a new project in VS 2012 RC and copying all of the code over, which I'd rather not do for every project we have. It could be a bug in VS 2012 RC, I don't know. I'll also note that I'm also getting an error saying "Cannot find or open the PDB file" that appears with the last event in the IntelliTrace output, but not sure if it's connected. Any help would be awesome.

Was it helpful?

Solution

It seems like you are hitting a bug we recently fixed in Intellitrace, but I can't be sure only by looking at the call stack. Can you have a try and let me know whether you can hit the exception when not debugging on "Web Development Server"?

To use IIS server instead of Web Development Server, please open project property, select Web tab, then select "Use local IIS Web Server". Web Development Server is selected by default in project created by VS2010, but the default for VS2012 created project is "IIS Server".

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top