我已經安裝了ASP.NET MVC 2 RC,打開默認的 「示例項目」,但出現以下錯誤:ASP.NET MVC 2 System.Web.Mvc.dll程序衝突
Parser Error Message: The type 'System.Web.Mvc.ViewMasterPage' is ambiguous: it could come from assembly 'C:\WINDOWS\assembly\GAC_MSIL\System.Web.Mvc\2.0.0.0__31bf3856ad364e35\System.Web.Mvc.dll' or from assembly 'C:\Documents and Settings\sfent\My Documents\Visual Studio 2008\Projects\MvcApplication1\MvcApplication1\bin\System.Web.Mvc.DLL'. Please specify the assembly explicitly in the type name.
這似乎是GAC dll和創建並放置在bin目錄(我認爲應該優先使用GAC版本)的dll之間的衝突
我已使用Google搜索此問題並發現了類似問題,但與不正確的命名空間有關。這是與MVC框架捆綁在一起的未更改的示例應用程序。
我也嘗試完全刪除框架並重新安裝RC,但無濟於事。
所有建議表示讚賞。
當您構建項目時,dll會自動在bin目錄中創建。我只參考v2並且只有v2在機器上。 – Fenton 2010-01-18 10:07:46
@索尼:您可以將引用程序集設置爲不復制到bin文件夾(右鍵單擊引用並選擇屬性)。 – Richard 2010-01-18 10:31:49
我認爲這個想法是你想在bin文件夾中的本地dll部署到「MVC未安裝」託管?我錯過了什麼。 – Fenton 2010-01-18 10:46:44