Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ASP.NET publish trying to copy a non-existant file

I'm trying to publish an ASP.NET project in VS2010, and am getting the following error:

Copying file bin\CKFinder.pdb to obj\Release\Package\PackageTmp\bin\CKFinder.pdb failed. Could not find file 'bin\CKFinder.pdb'.

I had tried using a trial version of CKFinder (with CKEditor), but I backed it out. I removed all references to CKFinder, including the folders and the references - or so I thought.

I've tried looking this error up, and have come up empty. This is getting frustrating.

Why is this error coming up? Ideas?

Thanks in advance . . .

like image 424
Ray K. Avatar asked May 22 '12 15:05

Ray K.


2 Answers

I also bumped to this problem. I was receiving the following error, when trying to publish MVCForum 1.7:

Copying file App_Data\NuGetBackup\Hello.txt to obj\Release\Package\PackageTmp\App_Data\NuGetBackup\Hello.txt failed. Could not find file 'App_Data\NuGetBackup\Hello.txt'.

François Breton's comment helped me achieve the solution.

It's simple:

Open your .csproj file with a text editor (Notepad, Notepad++) Visual Studio will open it as a project.

Press Ctrl + F and search for the file of the problem. In my case the file was "Hello.txt" without commas.

Under the <ItemGroup> it resided:

<ItemGroup>
<Content Include="App_Data\NuGetBackup\Hello.txt" />
<Content Include="Content\admin\Admin.css">
    <DependentUpon>Admin.scss</DependentUpon>
</Content>
...More code omitted due to brevity.

I deleted the <Content Include="App_Data\NuGetBackup\Hello.txt" /> line, and voila! Visual Studio allowed me to Preview before publishing!

It will end like this:

<ItemGroup>
<Content Include="Content\admin\Admin.css">
    <DependentUpon>Admin.scss</DependentUpon>
</Content>
...More code omitted due to brevity.
like image 165
Jose A Avatar answered Oct 12 '22 10:10

Jose A


Update: I went into Project --> Package/Publish Settings, and clicked "Exclude generated debug symbols." The project began publishing with no issue.

Update #2 (this is probably the better answer): I tried to publish as debug instead of release (yes, I wanted to keep the debug features in this particular release), and the error came up again. It turned out that I did not exclude the CKfinder.dll from the project. Once I did so, it ran with no problem.

like image 21
Ray K. Avatar answered Oct 12 '22 09:10

Ray K.