解决VS2010宏,不报错,不执行

 

  我在工程中添加了自动注释的宏,配置快捷方式后,始终无法执行,也并没有报错,查询资料得知:

VS2010 在2014年2月的更新中,破坏了宏模块,导致添加的宏,不报错,不执行。

  具体解决:对于64位win7系统,在以下三个文件内添加 vsmsvr10.exe.configvsaenv10.exe.config anddevenv.exe.config  内添加

<configuration> //文件内自带
    <runtime>   //文件自带
        <AllowDComReflection enabled="true"/>        //需添加的关键代码

  这三个VS配置文件一般位于以下目录:
"C:\Program Files (x86)\Common Files\Microsoft Shared\VSA\9.0\VsaEnv\vsmsvr10.exe.config"
"C:\Program Files (x86)\Common Files\Microsoft Shared\VSA\9.0\VsaEnv\vsaenv10.exe.config"
"C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\devenv.exe.config"

添加后,重启VS2010即可正常使用宏;

参考资料:http://visualstudioextensions.vlasovstudio.com/2014/02/13/visual-studio-2010-macros-stop-working-after-february-2014-windows-update/
posted @ 2015-12-09 19:14  Andy1314  阅读(500)  评论(0)    收藏  举报