過去,我只使用Visual Studio 2012「發佈到AWS」菜單項部署了我的MVC4網站(到AWS Elastic Beanstalk)。部署MVC4項目時出錯:無法找到文件或程序集
現在,程序編譯並在本地運行,但未能部署。從消息看來,它似乎在尋找不在正在部署的當前項目中的文件,它們也不是當前項目的參考文件。
對於某些嘗試部署,錯誤是無法找到無疑在文件系統和項目中的文件。 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,但錯誤依然存在!
我有同樣的問題(雖然我也掛@組裝包)。它看起來像它正在尋找c:\ WINDOWS \ System32中的web.config ... - ...包構建'ResolveAssemblyReference':在(0,0)處的'Web.config'中的錯誤:應用程序配置文件「Web .config「無效。找不到文件'C:\ WINDOWS \ system32 \ Web.config'。 – kingdango
請參閱更新的答案 – Jonathan