Home  >  Article  >  Database  >  VS2010中宏功能在2014年2月份的一个系统更新之后不能正常使用

VS2010中宏功能在2014年2月份的一个系统更新之后不能正常使用

WBOY
WBOYOriginal
2016-06-07 15:43:111523browse

为了编码的方便,在VS2010中添加了几个用于做注释的宏命令(Macros),之前一直工作正常,近期突然发现调用宏命令时,不能产生作用,并且没有弹出任何异常提示。 在网上查找到一篇文章:http://visualstudioextensions.vlasovstudio.com/2014/02/13/visual-s

为了编码的方便,在VS2010中添加了几个用于做注释的宏命令(Macros),之前一直工作正常,近期突然发现调用宏命令时,不能产生作用,并且没有弹出任何异常提示。

在网上查找到一篇文章:http://visualstudioextensions.vlasovstudio.com/2014/02/13/visual-studio-2010-macros-stop-working-after-february-2014-windows-update/

文中指出该问题是由于2014年2月份的一次windows系统更新,导致VS2010中的宏命令工作异常。

解决方法一:卸载导致问题的升级补丁

Windows update to uninstall to restore macros functionality in Visual Studio 2010
  .NET 4.5.1 .NET 4.5 .NET 4
Windows 8.1 KB2898871    
Windows 8 KB2898870 KB2898865  
Windows 7 KB2898869 KB2898864 KB2898855
Windows XP     KB2898855
解决方法二:编辑VS2010的运行配置文件

Update (February 18): To restore Visual Studio 2010 macros functionality without removing Windows updates, you can add the AllowDComReflection configuration setting (published by Jens) to vsmsvr10.exe.configvsaenv10.exe.config anddevenv.exe.config files (note, you need to run your editor with admin rights for correct modification of these files):

<configuration>
    <runtime>
        <allowdcomreflection enabled="true"></allowdcomreflection>
</runtime></configuration>

On a 64-bit Windows machine default paths to these files are:

"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"
笔者使用第2种解决方法解决了该问题。
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn