为什么Visual Studio找不到System.Web.Mvc.resources.dll?



我在Visual Studio中不断遇到这11个错误:

Error   456 Could not copy the file "_bin_deployableAssembliesdeSystem.Web.Mvc.resources.dll" because it was not found.   ViMuDat
Error   457 Could not copy the file "_bin_deployableAssembliesdeWebMatrix.WebData.resources.dll" because it was not found.    ViMuDat
Error   458 Could not copy the file "_bin_deployableAssembliesdeWebMatrix.Data.resources.dll" because it was not found.   ViMuDat
Error   459 Could not copy the file "_bin_deployableAssembliesdeSystem.Web.WebPages.resources.dll" because it was not found.  ViMuDat
Error   460 Could not copy the file "_bin_deployableAssembliesdeSystem.Web.WebPages.Razor.resources.dll" because it was not found.    ViMuDat
Error   461 Could not copy the file "_bin_deployableAssembliesdeSystem.Web.WebPages.Deployment.resources.dll" because it was not found.   ViMuDat
Error   462 Could not copy the file "_bin_deployableAssembliesdeSystem.Web.WebPages.Administration.resources.dll" because it was not found.   ViMuDat
Error   463 Could not copy the file "_bin_deployableAssembliesdeSystem.Web.Razor.resources.dll" because it was not found. ViMuDat
Error   464 Could not copy the file "_bin_deployableAssembliesdeSystem.Web.Helpers.resources.dll" because it was not found.   ViMuDat
Error   465 Could not copy the file "_bin_deployableAssembliesdeNuGet.Core.resources.dll" because it was not found.   ViMuDat
Error   466 Could not copy the file "_bin_deployableAssembliesdeMicrosoft.Web.Infrastructure.resources.dll" because it was not found. ViMuDat

我尝试构建一个由Visual Studio 2010开发的项目,但我正在使用Visual Studio 2012。如果我构建两次,则无误。

我该如何解决?

我发现了bin部署ASP.NET MVC 3和_BIN_DEPLOYABLEABESEMBLIES和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:53     321024 ViMuDat.pdb
-a---        18.12.2012     23:53     125308 ViMuDat.XML
D:...binde> 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

如果要bin部署MVC 3,则需要在部署中包装一些程序集。斯科特·汉塞尔曼(Scott Hanselman)也有很好的文章。

如果您复制了组件,请使用户添加,然后在您的Visual Studio项目中添加为"内容"。然后,当您构建时,它们将自动复制到bin目录中的正确结构中。

编辑:这是文章中有助于解决问题的信息:

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

C:Program Files (x86)Microsoft ASP.NETASP.NET Web Pagesv2.0Assemblies包含丢失的dll

这些DLL必须手动复制到我项目的_bin_deployableAssemblies

您可能会发现只需通过Nuget安装软件包。

nuget是一个软件包管理器,可以轻松在项目中安装和更新依赖项。这是一个可从这里安装的视觉工作室扩展。

如果您仍在使用ASP.NET MVC3,则可以使用命令Install-Package Microsoft.AspNet.Mvc -Version 3.0.20105.1安装旧版本。

这将添加作为正常参考的二进制文件,这些引用在构建项目时包含在bin文件夹中。这将节省您必须执行_bin_deployableAssemblies方法。Nuget上还提供了大多数其他受欢迎的第三方框架(以及许多新的Microsoft Web堆栈)。

相关内容

最新更新