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 (O
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.
I encountered this bug using VS2017 with a solution stored in OneDrive.I suspected OneDrive's sync mechanism to be the root cause of this. When I tried to reproduce using VS2019 however it did not reappear. Looks solved in between these versions.
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.
Make sure the obj folder is not read only, if so change read only property of this folder to false. this worked for me.
Check the permissions to the folder obj\Debug\ if you give it write permissions, the error would go away.
Delete the obj folder and build again.
Ref: http://forums.asp.net/t/1402005.aspx