8

我不斷收到在Visual Studio這11個錯誤:爲什麼Visual Studio找不到System.Web.Mvc.resources.dll?

Error 456 Could not copy the file "_bin_deployableAssemblies\de\System.Web.Mvc.resources.dll" because it was not found. ViMuDat 
Error 457 Could not copy the file "_bin_deployableAssemblies\de\WebMatrix.WebData.resources.dll" because it was not found. ViMuDat 
Error 458 Could not copy the file "_bin_deployableAssemblies\de\WebMatrix.Data.resources.dll" because it was not found. ViMuDat 
Error 459 Could not copy the file "_bin_deployableAssemblies\de\System.Web.WebPages.resources.dll" because it was not found. ViMuDat 
Error 460 Could not copy the file "_bin_deployableAssemblies\de\System.Web.WebPages.Razor.resources.dll" because it was not found. ViMuDat 
Error 461 Could not copy the file "_bin_deployableAssemblies\de\System.Web.WebPages.Deployment.resources.dll" because it was not found. ViMuDat 
Error 462 Could not copy the file "_bin_deployableAssemblies\de\System.Web.WebPages.Administration.resources.dll" because it was not found. ViMuDat 
Error 463 Could not copy the file "_bin_deployableAssemblies\de\System.Web.Razor.resources.dll" because it was not found. ViMuDat 
Error 464 Could not copy the file "_bin_deployableAssemblies\de\System.Web.Helpers.resources.dll" because it was not found. ViMuDat 
Error 465 Could not copy the file "_bin_deployableAssemblies\de\NuGet.Core.resources.dll" because it was not found. ViMuDat 
Error 466 Could not copy the file "_bin_deployableAssemblies\de\Microsoft.Web.Infrastructure.resources.dll" because it was not found. ViMuDat 

我試圖建立一個與Visual Studio 2010中開發的項目,但我使用Visual Studio 2012年。如果我建立了兩遍,它不工作錯誤。

我該如何解決這個問題?

我找到了Bin Deploying ASP.NET MVC 3_bin_deployableAssemblies and MSBuild,但我無法解決這些錯誤。請有人請一步一步解釋我應該怎麼做?我是C#和Visual Studio的新手。

我認爲這個錯誤也是爲什麼我不能檢入項目到TFS的問題。

我有這些組件在我的bin文件夾:

D:\...\bin> ls 
Mode    LastWriteTime  Length Name 
----    -------------  ------ ---- 
d----  18.12.2012  23:53   de 
-a---  15.12.2012  21:11  783648 EntityFramework.dll 
-a---  15.12.2012  21:11  834489 EntityFramework.xml 
-a---  18.12.2012  23:53  42496 LumenWorks.Framework.IO.dll 
-a---  18.12.2012  23:53  116224 LumenWorks.Framework.IO.pdb 
-a---  18.03.2010  18:31  53640 System.ComponentModel.DataAnnotati 
              ons.dll 
-a---  18.03.2010  18:31 1328984 System.Data.dll 
-a---  18.03.2010  18:31  919880 System.dll 
-a---  18.03.2010  18:31  24944 System.Web.Abstractions.dll 
-a---  18.03.2010  18:31 2824528 System.Web.dll 
-a---  05.01.2011  14:45  130408 System.Web.Helpers.dll 
-a---  03.05.2012  08:55  37861 System.Web.Helpers.xml 
-a---  05.01.2011  16:42  445280 System.Web.Mvc.dll 
-a---  03.05.2012  08:51  777665 System.Web.Mvc.xml 
-a---  18.03.2010  18:31  24928 System.Web.Routing.dll 
-a---  05.01.2011  14:45  136552 System.Web.WebPages.dll 
-a---  03.05.2012  08:55  51735 System.Web.WebPages.xml 
-a---  18.03.2010  18:31  941904 System.Xml.dll 
-a---  18.12.2012  23:53  244736 ViMuDat.dll 
-a---  18.12.2012  23:24 ViMuDat.pdb 
-a---  18.12.2012  23:53  125308 ViMuDat.XML 
D:\...\bin\de> ls 
Mode    LastWriteTime  Length Name 
----    -------------  ------ ---- 
-a---  12.01.2011  16:04  15720 System.Web.Helpers.resources.dll 
-a---  12.01.2011  17:24  32096 System.Web.Mvc.resources.dll 
-a---  12.01.2011  16:04  15208 System.Web.WebPages.resources.dll 
+0

你確實在你的'bin'文件夾中有這些程序集嗎? – Jared

+0

不,我在文章中添加了文件夾內容的列表。 –

回答

9

如果你是倉部署MVC 3,有一些組件,你必須在部署中打包。 Scott Hanselman has a good write up在什麼地方以及在哪裏。

如果您已經複製了程序集,請讓用戶將其作爲「內容」添加到您的Visual Studio項目中。然後,在構建時,它們將自動複製到bin目錄中的正確結構中。

編輯: 這是文章中的信息,幫助解決問題:

C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET MVC 3\Assemblies

C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET Web Pages\v2.0\Assemblies包含丟失的dll

這些DLL必須手動複製到_bin_deployableAssemblies我的項目。

5

您可能會發現通過nuget安裝軟件包會更容易。

NuGet是一個軟件包管理器,它可以很容易地安裝和更新項目中的依賴關係。這是一個Visual Studio擴展,可以從here安裝。

如果您仍在使用ASP.NET MVC3,則可以使用命令Install-Package Microsoft.AspNet.Mvc -Version 3.0.20105.1安裝較早版本的軟件包。

這將添加二進制文件作爲正常的參考文件,當您的項目被構建時,文件夾將包含在bin文件夾中。這將節省您必須執行_bin_deployableAssemblies方法。大多數其他流行的第三方框架(以及許多新的Microsoft Web堆棧)也可在nuget上找到。

+0

請提供更多信息。我不知道如何使用C#/ ASP.NET,只是簡單地提供流行語並不能幫助我(或任何其他初學者搜索這個問題的答案)解決問題。哪些nugets?他們如何在VS2012中安裝? –

+1

@moose按照鏈接,它會解釋nuget是什麼以及如何安裝和管理軟件包。 –

+1

http://meta.stackexchange。com/a/8259/158075 –

相關問題