Santiago Chiappa
Santiago Chiappa

Reputation: 29

Web Application publishing failed - Visual Studio - C# - ASP.NET

I have a web application developed in ASP.NET that compiles correctly, however it gives the following error when trying to publish it.

Copying file obj\Debug\CoreCompileInputs.cache to obj\Release\AspnetCompileMerge\Source\obj\Debug\CoreCompileInputs.cache failed. Could not find file 'obj\Debug\CoreCompileInputs.cache'.

Screenshot 1

We use three computers to publish this application (generate the Web Deploy Package). In one of these PCs the problem seems to be solved by following this steps:

But on the other two computers the following error continues to appear:

Error reading resource 'ProjectCycle.obj.Debug.ProjectCycle.Migrations.ModelsMerge.resources' -- 'Could not find file 'C:\Users\Chiappa\Documents\GitHub\ProjectCycle\ProjectCycle\ProjectCycle\obj\Debug\ProjectCycle.Migrations.ModelsMerge.resources'.' ProjectCycle    C:\Users\Chiappa\Documents\GitHub\ProjectCycle\ProjectCycle\ProjectCycle\CSC

Screenshot 2

Any idea why this might be happening?

Suggestions on how to correct this problem?

Summary:

I have an ASP.NET web application that compiles correctly but fails when trying to generate the Web Deploy Package.

Upvotes: 0

Views: 603

Answers (2)

Santiago Chiappa
Santiago Chiappa

Reputation: 29

I solved the problem by excluding the "obj" folder from the Visual Studio project.

Right clic on the "obj" folder in the Solution Explorer, Exclude From Project.

As simple as that!

Upvotes: 1

Heitor Corrêa
Heitor Corrêa

Reputation: 371

You could try going to the properties of the file and force the copy to the output directory.

  • Select the file on Solution Explorer
  • Press F4 OR Right-click and go to "Properties"
  • Change the value of "Copy to Output Directory" to "Copy Always"

Also, your Version Control may be locking the output directory (the "bin" folder), try deleting it manually.

Upvotes: 0

Related Questions