Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
340 views
in Technique[技术] by (71.8m points)

Macros don't run in Visual Studio 2010

Macros in Visual Studio 2010 cannot be started any more. They don't hit a breakpoint in their first line in the macro IDE. There is no error message. Macros can still be recorded, the code is shown in the macro IDE, but newly recorded macros cannot be started either. There is no error in the macro files, at least there is no error displayed in the error list. If I add an error intentionally, the error is getting displayed in the error list.

There is a short cursor change when I start the macro, but nothing else happens, and there is no output in the output view. It looks like there is a setting or option which prevents macros from running, but I cannot find any such setting. I experience the same problem on a second computer (on the same network), so maybe some Windows (7) update caused the problem. I did use macros frequently in the past without any problems and did not change the macros code recently.

Is anyone experiencing the same problem?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

On 2014-02-11, Microsoft released bulletin MS14-009 - Important. Vulnerability CVE2014-0257 is among the list of fixes. This relates to an elevation of privileges through use of reflection to execute code normally inaccessible to the caller. Part of the solution involves disabling reflection over COM interfaces. This resulted in a family of patches for all .NET Framework and Windows combinations. You can view the list through the link above.

Microsoft released a follow-up KB2934830 to address problems with running macros through Visual Studio. You will need to edit one or more of the following files as an administrator:

VS2005:

C:Program Files (x86)Common FilesMicrosoft SharedVSA8.0VsaEnvVsmsvr.exe.config

VS2008:

C:Program Files (x86)Common FilesMicrosoft SharedVSA9.0VsaEnvVsmsvr.exe.config

VS2010:

C:Program Files (x86)Common FilesMicrosoft SharedVSA9.0VsaEnvVsmsvr10.exe.config

Add this under the runtime section. runtime should already exist:

<AllowDComReflection enabled="true"/> 

This should make macros execute as expected.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...