Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error deploying MVC4 project: Cant find file or assembly

In the past I deployed my MVC4 website (to AWS Elastic Beanstalk) simply by using the Visual Studio 2012 "Publish to AWS" menu item.

Now, the program compiles and runs locally, but fails to deploy. From the messages, it seems to be looking for files that are not in the current project being deployed, nor are they references for the current project.

On some attempted deploys, the errors are that a file which is unquestionably on the file system and in the project, cannot be found. VS seems to be searching in the wrong locations and for not-required files.

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

I cleaned the project, repaired VS2012, but the errors persist!

like image 904
Jonathan Avatar asked Dec 13 '25 13:12

Jonathan


1 Answers

[Edit] As suggested by Jim Flanagan in the comments this is a R# (Resharper 8.2) integration issue. When R# is turned off (Tools | Options | Resharper | Suspend Now) deployment succeeds. (See http://youtrack.jetbrains.com/issue/RSRP-411186#tab=Similar%20Issues)

R# also (http://youtrack.jetbrains.com/issue/RSRP-411186) recommends to

turn on / off ability to use msbuild to obtain project references. You can find such option in R#->Options->VS Integration-> Use msbuild to obtain references

I was unable to find that option on my system (there is no VS Integration option; just "keyboard & Menus"), but completely disabing R# before deployment works like a charm.

like image 163
Jonathan Avatar answered Dec 16 '25 05:12

Jonathan



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!