0

I'm getting the "Unable to copy file, Access to the path is denied" error message when I try to build me release app. I can build it in debug though.

I last rebuilt in release mode about 15 minutes ago.

I have looked at a previous post on this site similar question however the answers on there didn't slove my issue.

I closed visual studio and deleted all the folders from my bin folder & rebuilt it with no luck. The release folder has the same properties as the debug.

One thing I did notice was that I delete all the files from the release folder, which is fine. Then I go back into that folder and some of the files I deleted have come back??

Any help before I lose all my hair would be great!

UPDATE

Thanks for the posts everyone. Turns out somebody was in my personal folder and had the application open for some unknown reason - they are safe as I have decided not to kill them :-)

Community
  • 1
  • 1
mHelpMe
  • 6,336
  • 24
  • 75
  • 150
  • 1
    Is the app running somewhere? (maybe in a background process that doesn't have a UI). That would lock out the files. Are the output files referenced in another project? – freedomn-m Nov 26 '15 at 13:25
  • 1
    You can use 'handle' (or similar) to find if any apps are locking the file: https://technet.microsoft.com/en-us/sysinternals/handle.aspx – freedomn-m Nov 26 '15 at 13:26

2 Answers2

1

Restart Visual Studio, if for some reason the process is hung and attached to VS that is what happens.

It happens sometimes with hung threads.

Gusman
  • 14,905
  • 2
  • 34
  • 50
1

Try to Clear this folder may be it will work

%AppData%..\Local\Microsoft\VisualStudio\11.0\ComponentModelCache

FOr VS2013

%AppData%..\Local\Microsoft\VisualStudio\12.0\ComponentModelCache

Akhil R J
  • 184
  • 2
  • 14