Reputation: 1205
When I publish, build , rebuild or clean solution, the following error is thrown:
Error 1 Unable to remove directory "bin\Debug\app.publish\". Could not find a part of the path 'HondaInstantFeedback.exe.config.deploy'. HondaInstantFeedback
But when I directly run it works perfectly. Its winform project and i am using vs 2010.
Upvotes: 6
Views: 20493
Reputation: 1
I hope I didn’t arrive too late. The definitive solution to my problem was to create a pre-build script that deletes the path. In Solution Explorer, search for the project name -> properties -> build -> build events. And write:
if exist "$(ProjectDir)bin\x64\Debug\app.publish" ( rmdir /s /q "$(ProjectDir)bin\x64\Debug\app.publish" )
Upvotes: 0
Reputation: 139
I stopped applications running, the ones showing up in the system tray, including google drive and anydesk. Rebuild works fine now.
Upvotes: 1
Reputation: 50
The directory cannot be on your OneDrive. If you want it on OneDrive then it is easier to clean the solution before building.
Upvotes: 0
Reputation: 1205
I tried one technique which was successful. I built the project on another system successfully and replaced the built code with my old code. Now every things works fine. I don't know the reason it worked but it saved me hours and hope it might help someone else.
Upvotes: 1
Reputation: 41
The problem with inability to Publish in Visual Studio 2010 and other versions is associated with behavior of new Windows versions, such as Win10. Even using Admin rights you find that you cannot set the Project file folder, on the C drive, to anything but Read-only using the File Explorer. The files that appear to be locked as Read-only causes the Publish wizard to fail in Visual Studio 2010, for example.
An easy approach to get around this trouble, adding to the notes above by others, try these actions:
Save your Visual Studio work.
Close the Visual Studio application.
Copy your project folder to another drive (not C).
Use Windows File Manager to right click on that copied file folder. Select the Properties. In the Properties panel, Un-check Read-only for the folder, and subordinate folders. Press the Apply button. On the popup panel, press OK to apply changes to this folder, subfolders and files. You should see a progress bar as the file permissions are being reset for all the underlying files and folders. Strangely, if you reopen the Properties of that upper folder, it will still show "Read-only" as checked, even though you unchecked it. Don't worry about that; the files in the folder can be changed by the Publish wizard, as it expects.
Launch your Visual Studio application again.
Open the project copy from the folder that is off the C drive.
You may try to pull down the Build menu item and find that some key lines like Publish are disabled. To resolve that, you must first Run the application from the Visual Studio. This seems to be another issue in Visual Studio, as it will disable the Publish button and other buttons until you Run the application first.
After that runs successfully, the Publish button should now be active, and should work properly.
Hope these notes help you the Publish capability back to your Visual Studio version.
Upvotes: 3
Reputation: 892
You may not have enough permission. I fixed this by running Visual Studio as an Administrator.
Upvotes: 0
Reputation: 51
I just moved my project folder (directory) from my desktop to D:. Now works like a charm. Somehow devenv can not access my desktop folder I guess.
Upvotes: 3
Reputation: 3668
If you have configured Visual Studio to 'Delete Existing Files' when publishing, Filezilla, WinSCP or other FTP programs can cause this error message if you have the FTP program open in the publish directory.
This is because Visual Studio is unable to delete the folder when the FTP program has the directory open.
I simply closed my FTP program and then Visual Studio 2017 was able to publish again.
Upvotes: 0
Reputation: 382
Had this issue. I just deleted the \app.publish\ folder in my project bin\debug folder.
Upvotes: 1