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 –

相关问题