Visual Studio 2017 error after rebuild of WPF RRS feed

  • Question

  • I try to make a WPF desktop application in Visual Studio 2017 in C#. I create an empty application. I dont modify XAML code or write any C# code at all.

    1. First I select START from the top menu, the debugger runs fine. I close the debugger

    2. I Select BUILD from the top meny, and then "Build solution". The empty applicaton builds with no errors

    3. I then select BUILD from the top menu, and then "Rebuild solution". Visual Studio then says that I have an error:

    Unable to copy file "obj\Debug\WpfApp1.exe" to "bin\Debug\WpfApp1.exe". Access to the path 'bin\Debug\WpfApp1.exe' is denied.

    I cannot get out of this error. The easiest way is to make another VS 2017 application and avoid use of "Rebuild solution"

    which seems to cause the problem. This is ok when you are in the start of your project, but this has occurred a couple of times

    at a later development stage, causing a lot of practical trouble. Is there any solution to this?



    Wednesday, October 4, 2017 11:27 AM

All replies

  • Hi Tore,

    Access denied could be caused by different reasons. Please try with following steps to troubleshooting this problem.

    1. Run your Visual Studio as administrator to make sure it has all permissions to access any paths.
    2. Close all other programs when using Visual Studio. It could help us check whether there has any other programs occupy your files.
    3. Check your computer to make sure it is not busy, such as CPU and Memory.
    4. Use Process Monitor to check which program occupy that file.

    Best Regards,

    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact

    Thursday, October 5, 2017 8:15 AM