部署MVC4项目时出错:找不到文件或程序集

时间:2014-04-01 04:17:04

标签: c# visual-studio-2012 amazon-web-services

过去我只是使用Visual Studio 2012"发布到AWS"以及部署我的MVC4网站(到AWS Elastic Beanstalk)。菜单项。

现在,程序在本地编译和运行,但无法部署。从消息中,它似乎正在寻找当前正在部署的项目中没有的文件,也不是当前项目的引用。

在某些尝试的部署中,错误是无法找到文件系统和项目中的文件。 VS似乎在错误的位置搜索和不需要的文件。

Commencing deployment for project MyWebApp.UI
...building deployment package obj\Debug\Package\Archive...
...package build 'CopyPipelineFiles': error in 'C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\Web\Microsoft.Web.Publishing.targets' at (2567,5): Copying file Content\bootstrap-fam-fam\css\fam-icons.css to obj\Debug\Package\PackageTmp\Content\bootstrap-fam-fam\css\fam-icons.css failed. Could not find a part of the path 'C:\MyWebApp\MyWebApp\MyWebApp.Model.Test\obj\Debug\Package\PackageTmp\Content\bootstrap-fam-fam\css\fam-icons.css'.
...build of project archive failed, abandoning deployment
Commencing deployment for project MyWebApp.UI
...building deployment package obj\Debug\Package\Archive...
...package build 'ResolveAssemblyReference': warning in 'C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets' at (1605,5): Could not resolve this reference. Could not locate the assembly "WebActivator". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.
...package build 'ResolveAssemblyReference': warning in 'C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets' at (1605,5): Could not resolve this reference. Could not locate the assembly "WebGrease". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.
...package build 'CopyPipelineFiles': error in 'C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\Web\Microsoft.Web.Publishing.targets' at (2185,5): Copying file Web.config to obj\Debug\CSAutoParameterize\original\Web.config failed. Could not find file 'C:\MyWebApp\MyWebApp\Amazon\obj\Debug\CSAutoParameterize\original\Web.config'.
...build of project archive failed, abandoning deployment

我清理了项目,修复了VS2012,但错误仍然存​​在!

1 个答案:

答案 0 :(得分:7)

[编辑] 正如Jim Flanagan在评论中所建议的那样,这是一个R#(Resharper 8.2)集成问题。当R#关闭时(工具|选项| Resharper |立即暂停)部署成功。 (见http://youtrack.jetbrains.com/issue/RSRP-411186#tab=Similar%20Issues

R#也(http://youtrack.jetbrains.com/issue/RSRP-411186)建议

  

打开/关闭使用msbuild获取项目引用的能力。您   可以在R# - > Options-> VS Integration->中找到这样的选项。使用msbuild   获取参考资料

我无法在我的系统上找到该选项(没有VS集成选项;只是"键盘和菜单"),但在部署之前完全禁用R#就像魅力一样。