过去,我使用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,但是错误仍然存在!