在win7下 vs2010/2012编译的时候经常出现fatal error LNK1104: cannot open file "Debug/test.exe",需要等待漫长的时间才能编译正常。用工具查询test.exe也没有被锁定,任务管理器里也没有在运行。这个问题一直困扰着我,刚开始以为是vs2010的bug,后来装了vs2012仍然存在这个问题,手动删除debug文件夹删除不了,所以肯定是win7权限的问题。
解决方案:(1)windows键+R ->输入services.msc 确定 (2)服务里面打开“APPLICATION EXPERIENCE SERVICE”就可以了。
原因:Compiler locks generated exe file when "Application Experience" service is turned off
描述
If realize that the Windows service "Application Experience" is consuming your hardware resources for nothing and decide to turn it off, you experience a fatal error in Visual Studio.
When this unnecessary service is turned off, Visual Studio locks generated exe file for at least a minute. And this makes code development impossible.
For temporary solution, you can either give a tea break every time after compiling your code instead of waiting for the exe file to unlock, or you can terminate MSBuild.exe from task manager every time you compile your code.