1

This isn't the first time I've had this problem. Unfortunately, I guess I didn't learn my lesson the first time. I was assuming it was another issue. I'm on a fresh install of Windows 7 Enterprise.

I installed 2010 and SP1. Everything was fine. I was working for a full week without a single issue.

I installed 2015. 2015 works fine, but 2010 is failing to clean-build projects...

Error 11 Could not copy "obj\Release\App.exe" to "bin\Release\App.exe". Exceeded retry count of 10. Failed. App
Error 12 Unable to copy file "obj\Release\App.exe" to "bin\Release\App.exe". The process cannot access the file 'bin\Release\App.exe' because it is being used by another process. App

It's even giving me this error, simply by trying to run Clean Solution:

Warning 1 Unable to delete file "C:\Source 2010\App\bin\Release\App.exe". Access to the path 'C:\Source 2010\Mimic\bin\Release\App.exe' is denied.  App

There is no permissions issue (I'm the administrator). There is no anti-virus program that's somehow affecting only 2010. I even tried running 2010 with admin rights, no difference. Deleting the bin folder doens't work either, as it won't let me when 2010 is running (when I'm having this problem).

Another oddity is that it WILL sometimes work by restarting 2010. Unfortunately, however, breakpoints fail to work: No symbols have been loaded for this document.

This is most definitely a problem with 2015's installation, possibly with just 4.6 itself.

Any ideas on what's going on? I'm dying here. I've been dealing with this for weeks and at my wit's end.

Keith
  • 1,331
  • 2
  • 13
  • 18
  • If App.exe cannot be deleted then you can never get it rebuilt. *Somebody* has a lock on the file. First check Task Manager to ensure it isn't running. Then use SysInternals' Handle utility to find out who's got it locked. – Hans Passant Sep 08 '15 at 12:01
  • @HansPassant Okay, got the Handle program working. http://i.imgur.com/cikmHmD.png Any ideas what's going on? I don't know what all of those files do/mean and what is out of the ordinary. – Keith Sep 08 '15 at 12:28
  • 1
    It says that your program is still running. Did you skip the Task Manager test? It gets easier to interpret when you use Project > Properties > Debug tab > untick the hosting process option. You can't get confused by the .vshost.exe process that way, you'll only see Main.exe. Use Tools > Attach to Process to find out why it isn't terminating when you expected it to. – Hans Passant Sep 08 '15 at 12:34
  • @HansPassant Okay, I'm really excited because that seemingly got around the problem. But why? That option has *always* been checked prior to installing 2015. Why would installing 2015 require me to disable it? In fact, it seems that I'm able to re-enable it and it's working. The mere action of unchecking it, rebuilding, etc. fixed the problem. Wow. I'm so happy and angry at the same time. And confused. I really appreciate it, Hans. – Keith Sep 08 '15 at 12:38
  • Assuming it is caused by VS2015 isn't going to get you anywhere. Only the debugger can tell you what is going on. – Hans Passant Sep 08 '15 at 12:43
  • Nice! @HansPassant shoot and hit, coding machine :) – Niels Filter Sep 08 '15 at 12:58

2 Answers2

0

Based on some suggestions made here and some others, see if these little tricks solve the problem:

1) In AssemblyInfo.cs do you use the "*" (something like this):

[assembly: AssemblyVersion("1.0.*")]

It seems that this doesn't go down too well in Windows 7. Try explicitly defining the version.

[assembly: AssemblyVersion("1.0.0.0")]

2) Is Windows Indexing Services running? Try disable it and rebuild.

3) Close you vshost.exe, VS and anything related and delete your obj and bin folders manually. Then rebuild.

4) Start Visual Studio up as Administrator and try again.

5) See if restarting the Application Experience service helps

6) Project Properties -> Build Tab -> Change output path to something else, rebuild, then change output path back to bin/Debug/

7) Another crazy one, make sure that you close ALL your designer tabs and then rebuild.

Hope you come right, these type of errors aren't fun to figure out.

Community
  • 1
  • 1
Niels Filter
  • 4,430
  • 3
  • 28
  • 42
  • None of that worked. AssemblyVerison is specified. I don't see a Windows Indexing Service, but I can open the project in 2015 and rebuild/debug no problem. I tried crashing the App.vshost.exe, no difference. Once the error is given during a build, I can't delete the obj folder. I already tried "As an administrator." :( – Keith Sep 08 '15 at 12:16
  • I should clarify further that this problem only came into existence the second 2015 was done installing. And that's happened twice on separate Win7 installations. I'm absolutely positive it's 2015 related. My concern is that removing 2015 will further break 2010, as evident by the fact that it's already broken it, which means it modified something 2010 uses. – Keith Sep 08 '15 at 12:18
  • I see. See if stopping the `Application Experience` service helps? – Niels Filter Sep 08 '15 at 12:22
  • Per your edit, I tried disabling the Application Experience service as well. I appreciate the ideas. – Keith Sep 08 '15 at 12:23
  • Apologies I meant restarting the `Application Experience` service. See if that does anything? – Niels Filter Sep 08 '15 at 12:26
  • Tried that too. No avail :\ – Keith Sep 08 '15 at 12:29
  • I actually already tried those things. It's not project-specific. It's all projects. I'm going to post the "answer" in a minute. Hans in the above comments figured it out. Literally unchecking "Enable the Visual Studio hosting process" under Project Settings -> Debug, and then rebuilding fixed the problem completely so far. I've even rechecked the option and it's still working fine. Something must've been broken and was "fixed" by messing with that checkbox option. I appreciate all of your ideas though. Thank you. – Keith Sep 08 '15 at 12:55
0

Figured it out and so far, so good, thanks completely to Hans Passant (see OP comments).

I change my Solution Configuration to Debug from Release, went into Project Settings -> Debug, and then unchecked the "Enabled Visual Studio hosting process" option. It gave a warning when I tried to rebuild, but it built just fine. Breakpoints were working. I even tried to Clean Solution and it worked. Restarted VS2010, changed back to Release mode, all is still well.

I also went back into the Debug options and re-enabled the option, and everything is still working.

The act of changing that option seems to have corrected the issue.

I want to reiterate for anyone else that might experience this problem: it happened twice in a row on two completely fresh Windows 7 Enterprise installs, breaking 2010 (with SP1) the second 2015 was done installing, pre and post reboot.

Keith
  • 1,331
  • 2
  • 13
  • 18