C# – Could not find file ‘obj\Debug\OldProjectName.csproj.FileListAbsolute.txt

asp.netcvisual studio 2010

I'm trying to publish project (tools vs2010), but cannot all the time getting the error below.
I paste to my projects files from another project and then I changed namespace (OldProjectName) to the parent project (NewProjectName). But it still getting information from somewhere about old project.

I cleaned solution, builded, rebuilded. Closed and reopened again and all the time the same error.

I'm able to build project but publish it.

Any ideas what can cause the problem?

Error 1 Copying file
obj\Debug\OldProjectName.csproj.FileListAbsolute.txt to
obj\Debug\Package\PackageTmp\obj\Debug\OldProjectName.csproj.FileListAbsolute.txt
failed. Could not find file
'obj\Debug\OldProjectName.csproj.FileListAbsolute.txt'. 0 0 NewProjectName

Best Answer

  1. Open your .csproj file in notepad

  2. Find "obj\Debug\OldProjectName.csproj.FileListAbsolute.txt"

  3. Remove that line and save it
  4. Open your project and try to publish it and this time you will be succeeded.

Note: if you are getting any more file like .pdb remove that as well.
Hope it will help you