VS2005 ~ VS2010 中宏不能运行的解决办法

来源:互联网 发布:蜀道难 知乎 编辑:程序博客网 时间:2024/05/29 03:18

其实这是一个老问题了,表现为你在VS中定义的宏快捷键按了没反应......

“微软就喜欢自己给自己下坑,然后顺带坑所有人” 偷笑


VS2005
C:\Program Files (x86)\Common Files\microsoft shared\VSA\8.0\VsaEnv\vsmsvr.exe.config

VS2008
C:\Program Files (x86)\Common Files\microsoft shared\VSA\9.0\VsaEnv\vsmsvr.exe.config

VS2010
C:\Program Files (x86)\Common Files\microsoft shared\VSA\9.0\VsaEnv\vsmsvr10.exe.config

解决办法:
在上述 .config 文件的 <runtime> 下面增加一行:<AllowDComReflection enabled="true"/>  或 <AllowDComReflection enabled="1"/>  即可
<runtime>  
   
<AllowDComReflection enabled="1"/>  
    ...
</runtime> 



另附:
Visual Studio 2010 Macros Stop Working after February 2014 Windows Update

Installing recent February 11, 2014 Windows updates breaks Visual Studio 2010 macros functionality. Macros just don’t run any more without an error message. More specifically, it is MS14-009 update “Vulnerabilities in .NET Framework Could Allow Elevation of Privilege (2916607)” (rated as Important) breaks macros. And more specifically it is the Elevation of Privilege part of this update.

Update (May 20): Microsoft released an update for Microsoft Visual Studio 2010 Service Pack 1 that fixes the issue of Visual Studio Macros stop working after installing MS14-009. 
Download KB2938807.
http://www.microsoft.com/en-us/download/details.aspx?id=42541

Update (October 25): Microsoft released an update for Microsoft Visual Studio 2008 Service Pack 1 that fixes the issue of Visual Studio Macros stop working after installing MS14-009: 
Download KB2938806. 
http://www.microsoft.com/en-US/download/details.aspx?id=42540

And similar update for Microsoft Visual Studio 2005 Service Pack 1: 
Download KB2938803.
http://www.microsoft.com/en-us/download/details.aspx?id=42945



0 0