proggrock
proggrock

Reputation: 3289

VS 2015 community- Publish failed due to build errors.

CLR-x86-1.0.0-beta7-15532

VS community v14.0.23107.0

Attempting to publish my Web API application to a local folder but right after the "Copying to output path C:\temp\PublishTemp", I get the following message:

Publish failed due to build errors. Check the error list for more details.

However, there are no build errors or warnings.

If I make a new web application it publishes to my test folder without issue.

Where should I start troubleshooting this?

Upvotes: 13

Views: 12662

Answers (5)

zapaischykova
zapaischykova

Reputation: 3

For me, the error was that the folder where it was trying to publish was not existing (weird) and it was lack of admin priveledges. So a solution is:


  1. To check if it publishes in the existing folder
  2. Start VS with admin rights

Upvotes: 0

Bigabdoul
Bigabdoul

Reputation: 981

It seems that you are missing a file that's included in the project but does not exist on disk at the expected location. This can happen when you move or delete the file from outside of Visual Studio (usually a non-compiled resource, such as files like .js, .css, .txt, etc.). If that's the case, try the following to solve the issue:

  1. Just locate the missing file in Visual Studio (it should have a yellow warning icon).
  2. Right-click on it and choose "Exclude From Project". If you don't need the file then you're good. If you do need, add it again from within Visual Studio.

I hope this helps.

Upvotes: 3

marcslevesque
marcslevesque

Reputation: 31

I was experiencing the same problem and the accepted solution did not help, because the problem was with publishing, and not building (despite what the error says). I tried the accepted solution but it didn't help because there were no errors when building.

The solution for me was one of 2 options:

  1. Remove the option (in the publish profile) to delete existing files when publishing
  2. Ensure nothing is preventing file deletion - or more importantly folder deletion - on the target machine

I had a command prompt window open on the server, in a folder in the project directory which was preventing the folder from being deleted.

Upvotes: 3

Eric Kelly
Eric Kelly

Reputation: 452

Sounds like Permissions if it happens at the copying portion or somthing is blocking the copying (existing files locked?), if you start VS as an administrator it should work if it's a permission issue.

Compilers always build to intermediate directories, for example, obj\configname. At the conclusion of the build process, the project system copies the files from the intermediate directory into the project output directory.

  1. To correct this error Restart Visual Studio.
  2. If you are working with a Web project, restart the Web server.
  3. The program may be running at the same time you are trying to build it. If this is the case, quit the program and rebuild.
  4. If the project references an output from another project as a file reference, and turns off Copy Local property for the reference, this might cause the compiler of the project that references the built file to lock that file. To resolve this situation, set the Copy Local property to true in the Properties window.

Upvotes: 2

Roman Pletnev
Roman Pletnev

Reputation: 6138

In Visual Studio go to Tools > Options and increase the MSBuild output verbosity. This will flood the Output window log with all the information you need:

enter image description here

Upvotes: 28

Related Questions