Question

I am compiling a bigger VB.NET project using VS2012.

Randomly, but very often after having run my project in Debug Mode, I get the error

"The output file <mypathhere> could not be written. Permission denied."

I have also tried using MSBUILD to give me more details about this error, but it didn't help. Also, I have tried disabling the Hosting option because I thought that this might be the cause, but it wasn't.

I used ProcessExplorer to find out which process might have locked my file, but it didn't show anything.

Does anybody have any more ideas?

When I try to set the application's output folder to not-writeprotected using the Windows properties dialog, I get the "Changing attributes denied. Permission denied." error on the output file.

Thank you very much!

Was it helpful?

Solution 2

The solution is to activate the Application Experience service in Windows. This is a known MS bug.

OTHER TIPS

There are a couple of reasons why this could happen

  • An instance of your program is currently running hence Visual Studio can't write over the file. Next time this happens check and see if any instances of your program are running in task manager.
  • An anti-virus program has a lock on your file to analyze it and prevents VS from overwriting it. Try excluding your project director from analysis and see if the problem dissapears
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top