Running Win7 (machine was delivered with it) and Visual Studio 2008 (ver 9.0.21022.8 RTM).
Created a console app, simple “Hello World, again”, F7 compiles, F5 runs, all is good. Made minor formatting change, F7 compiles fine, but “fatal error LNK1104: cannot open file ‘C:…\Debug\test.exe’ linker error. Undo minor edit, F7 compiles fine, but same fatal LNK error. Reviewed question here: Visual studio 2008 error ? "LNK1104 : cannot open file " and worked with the suggestions listed with these results:
Exe running? Checked TaskMgr and no. Compiled w/F7 – linked! F5 runs good, TaskMgr says not running, Minor edit & F7 – LNK1104 error! Ran this test several times and cannot catch the exe staying in TaskMgr past the apps termination (it appears then goes away), yet F7 still failes with LNK1104. More research…
Told antivirus to exclude my dev directory. F7 linked, F5 ran good. Minor edit F7 LNK1104 error. Turned AV off completely. F7 LNK1104 error. More research…
F7 linked! Say what? Minor edit, F7 linked! Minor edit F7 linked! Minor edit F7 linked! (several in a row looked promising.) F5 ran good. Minor edit, F7 LNK1104 error. Wait 3 or 4 minutes, F7 linked! Minor edit F7 linked! Minor edit F7 linked! So waiting 3 or 4 minutes seems to make things ok, but if I run the app, I must wait 3 or 4 minutes. Why?
So I opened a File Explorer window and navigated to the …Debug directory. Minor edit F7 LNK1104 error. Used shift-Del to actually delete the file. F7 LNK1104 error. Had to wait 3or4 min before F7 linked.
As I was messing around in File Explorer I noticed something very curious, and related to when F7 links or not. When I delete the exe, I can then use (the old fashioned, now undocumented refresh F5 key) and the exe file shows back up again! Until the 3 or 4 minutes have expired, then it does not show up again (or if it’s showing, it disappears). I have also determined that this phantom exe (i.e. after I have done an unsuccessful F7 or deleted it and shown it back up in File Explorer with F5), though it shows the same size as the original exe, it will not execute (File Explorer, when I try to execute the exe, says “Windows cannot access the specified device, path, or file.”)
Sorry for the verbosity! I also tried turning off indexing, no difference. I’ve tried everything I can think of, including nuking tasks in task manager until my system rebooted itself (oops!). Why is the file not really deletable/overwrite-able for 3 or 4 minutes and what can I do about it?
MS Forum suggests to enable “Application Experience” service.