Exception was thrown by the target of an invocation – Visual Studio 2010 | 2012

After installing some recent updates to some visual studio extensions and features, I started getting the following error when I was trying to start up Visual Studio 2010 or Visual Studio 2012.

“exception was thrown by the target of an invocation”

After Googling around for a little bit, I found a Stack Overflow article which described the issue. Apparently there is a max length to the Path System variable (I believe is 2048 characters), which if exceeded, will prevent a few different apps from functioning correctly, including Visual Studio 2010 and 2012. However, if you attempt to go to System, then to Advanced System Settings you will get another error because the path is too long.

“windows cannot find ‘ %windir% system32 systempropertiesadvanced.exe’ “

So, to correct this the first time, follow these steps :

  1. Go to your system32 folder in your Windows Directory (Most likely will be C:\Windows\System32)
  2. Find and run the executable System was trying to find – systempropertiesadvanced.exe
  3. You should be on the Advanced tab. If you are not, go there. Click Environment Variables
  4. Under the System Variables group, find the Path variable. Click Edit
  5. Copy to notepad, or text editor application. Delete unnecessary entries
    1. Make Sure the following stays (It’s Windows 7 default) – %SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\Syst‌​em32\WindowsPowerShell\v1.0\;
  6.  Copy back to the Variable Value, hit ok through all the dialogs, and you will be good to go!

* Please note you won’t see icons back for folders, etc… until Explorer is restarted. You will be able to open up Visual Studio right away again however.

Jacob Saylor

Software developer in Kentucky

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: