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.
MS14-009 includes several updates for different OS and .NET versions. To restore Visual Studio 2010 macros functionality you need to uninstall the Elevation of Privilege patch specific for your machine. For example, on a Windows 8.1 machine you need to uninstall KB 2898871:
.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 |
The Visual Commander extension (a modern alternative to Visual Studio macros) is not affected by this Windows update.
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.config, vsaenv10.exe.config and devenv.exe.config files (note, you need to run your editor with admin rights for correct modification of these files):
<configuration> <runtime> <AllowDComReflection enabled="true"/>
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"
Each of these files already has the runtime section, you just need to add the <AllowDComReflection enabled="true"/> line:
To restore Visual Studio 2008 macros functionality, you need to add AllowDComReflection to the following files:
"C:\Program Files (x86)\Common Files\Microsoft Shared\VSA\9.0\VsaEnv\vsmsvr.exe.config" "C:\Program Files (x86)\Common Files\Microsoft Shared\VSA\9.0\VsaEnv\vsaenv.exe.config" "C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE\devenv.exe.config"
Update (February 25): Microsoft published KB2934830 “Marshaling of reflection types may not work over DCOM after you install a security update from security bulletin MS14-009”. It acknowledges that macro functionality in Microsoft Visual Studio may not work as expected after installing MS14-009. As a workaround to restore the functionality of Visual Studio macros, the article suggests updating one of the following application configuration files, depending on the version of Visual Studio that is installed on the system:
Visual Studio 2010 | c:\Program Files (x86)\Common Files\Microsoft Shared\VSA\9.0\VsaEnv\Vsmsvr10.exe.config |
---|---|
Visual Studio 2008 | c:\Program Files (x86)\Common Files\Microsoft Shared\VSA\9.0\VsaEnv\Vsmsvr.exe.config |
Visual Studio 2005 SP1 | c:\Program Files (x86)\Common Files\Microsoft Shared\VSA\8.0\VsaEnv\Vsmsvr.exe.config |
You need to add the AllowDComReflection configuration switch in the <runtime> section of an .exe.config file as follows:
<?xml version ="1.0"?> <configuration> <runtime> <AllowDComReflection enabled="1"/> </runtime> </configuration>
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.
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. And similar update for Microsoft Visual Studio 2005 Service Pack 1: Download KB2938803.
thx for help
Its true, same happened to me.
Unistalling both KB2898869, KB2901126 solved the problem.
Thanks!
Great.
I’ve the same problem, but I’m (comprehensible) not allowed to uninstall security updates.
So, is there a way to use macros anymore AND be protected against attacks?
Both is desirable. I think…!
I don’t have a solution at the moment. I think Microsoft developers have a better chance to resolve this problem.
You can add the AllowDComReflection setting to Visual Studio 2010 config files and restore macros without unistalling Windows updates. See the update.
Uninstalled KB2898869. It’s working now.
Thank you very much. You’ve saved me a lot of frustration
Uninstalled KB2898855v2 and it’s working now too ! Thanks !
Many thanks for your help.
Unistalling both KB2898869, KB2901126 solved the problem.
Cheers
thank you!
It also breaks VS 2013 Express for Desktop on Win 8.1
This is new to me. Can you please describe what is broken in VS 2013 Express now?
You can’t even launch VS.
It just show a message saying “Operation could not be completed. No such interface supported.”
It also broke some of my wpf applications but, oddly enough, only some of them.
After uninstalling KB2898871 it works again, so I have just hidden the update, so Windows doesn’t decide to re-apply it.
Apparently it breaks more than it fixes. ;o)
This update also broke macros in VS 2008 on my 64-bit Windows 7 system. I had to uninstall KB2898857 to fix it.
Thanks. The update broke macros in VS 2008 on my 64-bit Windows 7 system. I had to uninstall KB2898857 to fix it.
This update broke macros in VS 2008 on may 64-bit Windows 7, too. Uninstall KB2898857 fixed it.
Yeah. Uninstall this **** (KB2898857) and it works again.
Would it be theoretically possible to extend Visual Commander so that it can also be used in VS.NET up to 2008?
Hermann,
I think it should be possible to port Visual Commander for Visual Studio 2008. But if Microsoft fix this problem, there will be no need for it.
On my Win7-64bit, uninstalling KB2898869 launches “Update KB2858725 Uninstallation”, which fixed the problem. After reboot, it immediately offers the KB2898869 update again. Hide it so it won’t reinstall.
After buying VS 2012, I’ve never used it due to the removal of macros; I’ve stuck with 2010. Then this happened.
Christ, I get so tired of MS breaking my stuff!
I’m going to give Visual Commander a try. Thanks for the help.
Thank you
Uninstalling KB2898869 fixed this issue for me 🙂
For VS 2008 on XP uninstalling KB2898856 worked for me.
Removing KB2898869 on Win7 fixed the issue.
Cheers. You’ve saved me many hours. Good ol’ microsoft updates!
Thanks for this help. Win 7 64bit, ms office 2010. VS2010. I had to remove KB2898855 & KB2898855v2 Service pack 2 for Office 2010 and VS works again.
These updates also broke macros in VS2005. I uninstalled all of the updates from Feb 2014 (one of which was KB2898857) and macros started working again.
Thank you for your update about AllowDComReflection!
Modifying the config files really save the day!
Thanks!
Thanks !!!!
Worked for me just modifying the first two .config files:
“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”
Thanks. The XML edit did the trick.
Modifying the first two config files worked for me. Thanks for the post!
Had the same problem with VS 2007 and Windows 7 64. Removal of KB2898857 fixed the nightmare. Is there a way to do this in VS 2007 with a config file?
There is no VS 2007 as far as I know. Did you mean VS 2005 or VS 2008?
I can confirm the config file fix described above worked for me with VS 2005. The config filenames are pretty much the same, but just a different version number in the folder path and config filenames.
Removing KB2898871 and adding to the config files don’t do trick on Wondows 8.1 Pro. Note, that VS2010 installed on the machine after windows update.
Excellent! I rely on my macros for a number of utility functions, I wasn’t relishing the though of having to re-code them as I read will be the case with VS2011
Thank you!!!
Pingback: visual studio 10 에서 매크로 안먹힐때 | Tech Griffin
Config files fix (VS2010, Win7-64) worked for me too. Thanks!!!
Thank you so much.
I have changed all 3 files and my VS2005 now work
I got the same problem. Many thx for posting this.
THANK YOU for the AllowDComReflection fix. So grateful!!!
Editing .config file according to “Update (25-FEB)” was only allowed with administrative rights on my windows 7 system.
I’ve edited a copy of according config file in a different directory, and then moved the edited file back to original location.
The AllowDComReflection fix worked like a charm. Thank you!
Thx, this solved my problem.
I rewrote the content of the KB article to Stack Overflow http://stackoverflow.com/a/22063369/256431 acknowledging I first found your page via Google.
Awesome! Thanks!
Thanks.
This fixed my VS2005 issues with macros not running.
Thanks, Excellent….
Awesome!!! Thanks for the tip!
THANK YOU, wow – i thought i have to reinstall, since i checked everything; i also changed the macro, since i thought it became buggy for some reason… 😀
Regards,
Lelala
Excellent. Yes some of us (who aren’t a fan of typing unnecessarily) do actually use visual studio macros
No solution seems to work for me 😦
I tried editing the config files as explained, both for VS2008 and VS2010 (I’m using 2010); I tried setting value to “true”, as per your instructions, and to “1” as per KB2934830; I tried also to uninstall the only guilty update I found (KB2898869).
Still not working.
I did shut down VS before each attempt (and looked for it to be really not running, same for the two additional processes in C:\Program Files (x86)\Common Files\microsoft shared\VSA\9.0\VsaEnv: vsaenv10 and vsmsvr10), but not restarted the PC yet.
Tried also to create a new test macro with a simple MsgBox in it and launching from custom toolbar: no success.
I don’t understand what I am missing.
Running VS 2010 SP1 on Windows 7 x64, both ITA language with Administrator user and UAC off.
Anyone having some hint?
There are could be other reasons for macro to not run, e.g. a syntax error in any macro, see http://stackoverflow.com/a/4910059/84507.
Oops. You’re right… In an attempt to fix the original problem (obviously not yet knowing about the MS Update) I added some line of code, but unintentionally introduced a syntax error.
Now, selectively removing some code I found this other problem.
Many Thanks, I knew it had something to do with me. 🙂
Excellent, it works without uninstalling anything.
Thanks, this is solved my problem with out uninstalling any updates
Thank you! The config changes worked flawlessly! Much better than having to uninstall patches.
THANKS A LOT!
Adding fixed it….. thanks again!
Reblogged this on MFC Tips.
Thanks!
Adding the to vsmsvr10.exe.config fixed it for me.
I can confirm that the “AllowDComReflection” solution works for 2008.
Hello and many thanks to the first who gives the idea “AlolowDComReflection…”! I was looking some weeks for a solution to the macro Problem. Now it works as before.
I was seeing the prompt to save macros when exiting VS. Inserting AllowDComReflection into the 3 .config files did NOT help. Installing KB2938807 fixed it. HTH.
Perfectly fine, I have update .config-s and everything works.
Pingback: The strange case of VS 2010 Macros stop working after February 2014 Windows Update | Visual Studio Extensibility (VSX)
I had the same problem, on both VS2010 and VS2008. until I landed googling on this page… hurrahhh!
Updated all *.config files, rebooted, but did not work… macros still dont work (blocked somehow internally)
But after applying the previously suggested patch, VS2010 jumped ok,
But VS2008 still don’t work, just updated towards SP1, uninstalled all the suggested patched to 4.5.1, most of them are not even instaleld here!
¿any clue? thanks all anyway!
A billion thanks! I added the element to the files you described and my macros started working again after I restarted Visual Studio (2010).
I fixed macro issue in VS 2008 using the instruction here back in Feb 2014 but in the month macros have stopped working again in 2008 and all the settings are still there per the instructions. Anyone else experiencing this? I really miss my macros 😦
You can try to install KB2938806 – an update for Microsoft Visual Studio 2008 Service Pack 1 that fixes the issue of Visual Studio Macros stop working after installing MS14-009.
Microsoft also 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. http://www.microsoft.com/en-US/download/details.aspx?id=42540
For Visual Studio 2005: http://www.microsoft.com/en-us/download/details.aspx?id=42945
Thank you for the information! I’ve updated the post.
Macros are not running at all with Microsoft Visual Studio 2010 on Windows 8.1. I get no error messages when trying to run the macros.
I’ve already tried to install the update for Microsoft Visual Studio 2010 Service Pack 1 (KB2938807) but this does not solve the problem.
I’ve also uninstalled Microsoft Visual Studio 2010 and did a clean installation but the problem is still there.
We are only testing the sample macros i.e. it is not a syntax problem.
Karen,
It is unusual that nothing in this post helps. As an alternative you can run your macros in Visual Commander.
Hi Sergey
Thanks for the reply. I did get it working in the end. Installed KB2938807 again. I’m not sure if I slipped up the first time and didn’t install but its working now.
Best Regards
Karen
Thanks alot, I have the problem with VS2010 on Windows 7 x64 after installed .net 4.5.2 upgrade, the fix works.