0

I'm working on a windows forms project that uses WIN32 api to access desktops icons (ipc with explorer.exe). Don't know if it has anything to do with that process, but when I start the project in DEBUG mode, it just freezes up and closes itself. When I try to build it a second time, I get the error that he won't copy the .exe from \obj to \bin, probably because it's locked by some process. If I try to build with RELEASE then it doesn't freeze up and it "works" but when closing it within visual studio (stop button) I can't build it a second time. Only when I close the form itself (and even then sometimes it works, sometimes it doesn't).

I've looked already here: Unable to copy a file from obj\Debug to bin\Debug but that doesn't make any difference. I also came across this: msbuild.exe staying open, locking files but unless I'm setting the environment variable wrong, it doesn't work either. Sometimes MSBUILD.exe stays indeed open, but not always.

I have 2 projects in my solution: a class library and a windows forms project. The DLL seems to compile file, but the exe of the forms won't work exactly.

The only 'solution' that works is to reboot each time I come across the error, and run project in RELEASE until it decides to stop working randomly. That's impossible to work with so if any of you know any solution. Please let me know!

I'm using VS2017 on Win10 home (latest public build available atm), it is only in this project not in other projects and I tried running as admin and such things.

Project repo: https://github.com/jclaessens97/IconsRestorer

Thanks in advance!

NOTE: I tried it with a WPF project too and at first it works, but after that, same result as the forms project.

JC97
  • 1,530
  • 2
  • 23
  • 44
  • Which version of VS are you using? What OS and version are you on? Did you try to run as Administrator? – pookie Aug 17 '17 at 09:00
  • VS2017, Windows 10 home edition (latest public build), tried running as Admin: check! – JC97 Aug 17 '17 at 09:03
  • Does it happen with all projects or just a particular one? – pookie Aug 17 '17 at 09:06
  • Just this one. That's why I noted that I'm using WIN32 api. But I find it weird that it freezes when in Debug, but sometimes works in Release... If you want I can post a link to the github repository – JC97 Aug 17 '17 at 09:08

0 Answers0