Could not find file 'obj\Debug\OldProjectName.csproj.FileListAbsolute.txt

▼魔方 西西 提交于 2020-01-12 02:53:52

问题


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


回答1:


  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




回答2:


Make sure the obj folder is not read only, if so change read only property of this folder to false. this worked for me.




回答3:


Check the permissions to the folder obj\Debug\ if you give it write permissions, the error would go away.




回答4:


It is your responsibility to make copies so you can go back to one.

Open your project file (vb/cs)proj with a notepad, and search for the missing files.

In my case I got this error when I tried to publish the project and certain files were not found.

Each publish attempt I got another file name, after checking that the file actually didn't exist in the project, I removed it from the project file, manually.

Then publish succeeded.




回答5:


Delete the obj folder and build again.

Ref: http://forums.asp.net/t/1402005.aspx




回答6:


Check if the folders "bin" and "obj" are checked-in to source control, if so delete those two folders in source control. There is no need to check-in these two folders to source folders. Also make sure that these folders "obj" and "bin" are deleted from your hard disk, they will be created again after a build.

Hope this will fix your issue.




回答7:


I too had this problem. I resolved this by deleting files inside project bin folder (.dll and .pdb) and closed and re-opened VS .




回答8:


Like many others these files were read only and needed to be deleted or actually able to be overwritten by VS. However, as may be the case for many others, the problem was because these files were checked in to source control. Your bin and obj folders should not be in source control. Mark them for delete and submit the changelist.

One exception to the rule is for the bin folder could be dll files that are not .Net compatible. Such as a C/C++ dll that you are using through a .Net wrapper dll. I mark them as content so that they get published and check them into source control.




回答9:


For me using solution here: Certain Razor views not publishing

Excluding the views folder and re-including fixed it for me. So it's possible for anyone else experiencing this it may be as simple as excluding and then including the file/folder in question of your project.



来源:https://stackoverflow.com/questions/5346984/could-not-find-file-obj-debug-oldprojectname-csproj-filelistabsolute-txt

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!