2011-03-28 102 views
2

我創建了一個全新的ASP.NET MVC 3項目,並且在不做任何更改的情況下運行它以觀察項目模板行爲,並且我收到「Method not found error」下面是完整的堆棧跟蹤。新的ASP.NET MVC 3項目錯誤

當我在對象瀏覽器中查看WebPageContext對象時,我發現確實沒有匹配調用構造函數的方法簽名。 System.Web.WebPages參考解析爲C:\ Program Files(x86)\ Microsoft ASP.NET \ ASP.NET Web Pages \ v1.0 \ Assemblies \ System.Web.WebPages.dll。

我試圖重新安裝ASP.NET MVC 3 RTM以及VS 2010 SP1,但沒有運氣。請幫忙。


錯誤消息:


Method not found: 'Void System.Web.WebPages.WebPageContext..ctor(System.Web.HttpContextBase, System.Object, System.Collections.Generic.IDictionary`2)'.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.MissingMethodException: Method not found: 'Void System.Web.WebPages.WebPageContext..ctor(System.Web.HttpContextBase, System.Object, System.Collections.Generic.IDictionary`2)'.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[MissingMethodException: Method not found: 'Void System.Web.WebPages.WebPageContext..ctor(System.Web.HttpContextBase, System.Object, System.Collections.Generic.IDictionary 2<System.Object,System.Object>)'.] System.Web.Mvc.ControllerBase.Execute(RequestContext requestContext) +0
System.Web.Mvc.ControllerBase.System.Web.Mvc.IController.Execute(RequestContext requestContext) +10
System.Web.Mvc.<>c__DisplayClassb.<BeginProcessRequest>b__5() +37 System.Web.Mvc.Async.<>c__DisplayClass1.<MakeVoidDelegate>b__0() +21 System.Web.Mvc.Async.<>c__DisplayClass8
1.b__7(IAsyncResult ) +12 System.Web.Mvc.Async.WrappedAsyncResult`1.End() +62 System.Web.Mvc.<>c_DisplayClasse.b_d() +50 System.Web.Mvc.SecurityUtil.b_0(Action f) +7
System.Web.Mvc.SecurityUtil.ProcessInApplicationTrust(Action action) +22
System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +60
System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult result) +9
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +8862669 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +184

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.431

回答

2

問題出在Visual Studio異步CTP安裝。顯然SP1不喜歡Async CTP。

我卸載了Visual Studio 2010 Beta1以及ASP.NET MVC 3以及Visual Studio Async CTP,然後重新安裝了Visual Studio 2010 SP1,現在一切正常。

這花了太多時間,可惜這個問題花了整整一天的時間才解決,微軟真的應該一起行動起來。

0

你提到試圖重新安裝MVC 3 RC。請注意,RC不再受支持。請安裝RTM版本並重試。這應該可以解決您的問題。

+0

我的錯誤,RTM – Keith 2011-03-28 18:29:03