asp.net-mvc-3 - 为什么 Visual Studio 找不到 System.Web.Mvc.resources.dll?

标签 asp.net-mvc-3 visual-studio-2010 razor tfs visual-studio-2012

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

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 新手。

我认为这个错误也是我无法将项目 checkin 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:\...\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

最佳答案

如果您要对 MVC 3 进行 bin 部署,则必须在部署中打包一些程序集。 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 中。

关于asp.net-mvc-3 - 为什么 Visual Studio 找不到 System.Web.Mvc.resources.dll?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13942703/

相关文章:

asp.net-mvc-3 - 在 MVC3 页面 EF4 上使用 AJAX 部分回发带有下拉列表的页面

visual-studio - 无法创建新项目或项目 : Visual Studio 2010 dialog initialization exception

c# - RedirectToAction 不适用于 $.post

asp.net-mvc - ASP.Net MVC 中 UIHint 属性的用途是什么

c# - 使用 ViewModel 来自具有默认值的 Enum 的 DropDownListFor

asp.net-mvc-3 - ASP.NET MVC 3 中的每日调用速率限制?

c# - EntityFramework 存储库从接口(interface)和抽象类 : how to use dependency inject on ASP. NET MVC 驱动

c# - 如何将现有程序集转换为 ms 单元测试程序集?

c++ - 用 C++ 为非英语语言打印字符串

c# - DisplayFor 不适用于具有不同命名空间的相同模型名称