先週 TechEd で IntelliTrace について学んだ後、今朝 Visual Studio 2012 Ultimate RC をインストールしました。現在、VS 2010 Professional を使用しているため、2012 RC を使用することが、IntelliTrace をテストするための唯一の簡単なオプションでした。
VS 2012 Ultimate RC を開き、VS 2010 で記述された MVC 3 プロジェクトを開きました。「IntelliTrace イベントのみ」に設定すると、IntelliTrace は正常に動作します。ただし、「IntelliTrace イベントと呼び出し情報」に設定すると、デバッガーの起動時に例外が発生します。
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:
問題は、Microsoft.VisualStudio.WebHost.Server.OnSocketAccept への関数エントリのどこかにあるようです。私はこれが何であるか分かりません。
いくつか試してみたところ、次のことがわかりました。
- VS 2010 で作成された Web フォーム プロジェクトを開くと、問題は発生しません。
- VS 2012 RC で新しい MVC 3 プロジェクトを作成すると、問題は発生しません。
- この問題は、VS 2010 で作成された MVC 3 プロジェクトを開いた場合にのみ発生します。
VS 2012 RC で新しいプロジェクトを作成し、すべてのコードをコピーする以外に、これを試して修正する方法について困惑しています。VS 2012 RC のバグかもしれませんが、わかりません。また、IntelliTrace 出力の最後のイベントに表示される「PDB ファイルが見つからないか、開くことができません」というエラーが表示されることにも注意してください。ただし、接続されているかどうかはわかりません。どんな助けでも素晴らしいでしょう。