"Exception selected by target" when starting Visual Studio 2010

When I start Visual Studio 2010, I often get the error 'exception has been thrown by a target of invocation' , which prevents me from opening Visual Studio. Rebooting my computer makes the error go away, but after a few days it returns.

What causes this error and how can I get rid of it?

I found many questions about SO that mention this error when running their code in Visual Studio, but nothing happens when opening Visual Studio.

+46
visual-studio-2010
Oct 05 '12 at 16:30
source share
13 answers

It seems like the problem was that my system path became too long for Windows: it was 2087 characters long (hint for a hat in this article ).

+81
Oct 05
source share
β€” -

I had this problem with Visual Studio 2012 today. During the first setup, something went wrong, so it helped to remove the following registry entries:

 HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\11.0 HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\11.0_Config 

Then Visual Studio will be configured again at startup. You can also just rename .

+8
Jul 19 '13 at 17:01
source share

I had the same problem with Visual Studio 2012 and SQL Server Management Studio, the solution was to reduce the SYSTEM PATH variable length .

Symptoms: After starting one instance of Visual Studio 2012, any other attempt to start another or one of SQL Server Management Studio will fail. Rebooting the computer will allow me to start one instance of VS2012 again. Restoring the VS2012 installation did not help.

+5
Nov 08 '13 at 19:54
source share

None of these solutions solved the problem with my Visual Studio 2012, but I was finally able to fix it by installing the latest update 4 from the Visual Studio website

+3
Feb 03 '14 at 4:23
source share

My path also seemed to affect access to Advanced System Settings from Control Panel \ system \ Advanced system Settings, so I was unable to edit the path.

I had to run this from the \ system32 window to display the Advanced System Settings dialog box, and then edit the environment variables.

The last installation of the MEAN stack added a path statement for my user account. I completely deleted this option, and then VS2010 and the Advanced System Settings dialog box started without any problems.

+3
Jan 12 '15 at 12:13
source share

BioGeek's answer fixed my problem. In my case, overflowing the system path not only violates the visual studio, but also violates the graphical interface for changing the system path itself.

I got an error: Control Panel> System> Advanced System Settings.

The workaround is run c: \ windows \ system32 \ SystemPropertiesAdvanced.exe.

+3
02 Sep '15 at 21:58
source share

I had a similar problem when trying to launch the " Task Launch Explorer " in VS2015 , I received an error message: " An exception was thrown by the invocatio n target ."

I solved this by reinstalling only Microsoft ASP.NET and Web Tools "(DotNetCore.1.0.0-VS2015Tools.Preview2.exe) from this one .

+3
Jul 31 '16 at 7:24
source share

I got this error when I installed SQL Server Express 2014 on a machine that was already in 2012. I installed it using tools that apparently violated SSMS 2012. In particular, an error was selected when trying to "Change the top 200 lines".

Using SSMS 2014 seems to work just fine.

+2
Jun 17 '14 at 13:38 on
source share

Add to response BioGeek. You do not need to get rid of the entries in your path; you can bypass the character limit by entering more variables.

eg.

 PATH = {1800 CHARACTER LONG STRING}{500 MORE CHARACTERS} 

You would add the EXTENDEDPATH variable, for example:

 EXTENDEDPATH = {500 MORE CHARACTERS} 

And finally, you reference this variable in your PATH

 PATH = {2000 CHARACTER LONG STRING};%EXTENDEDPATH%; 

I would recommend leaving at least 100-200 characters in the breathing room, so you do not need to look after the PATH environment variable every time you set something.

+1
May 13, '16 at 15:43
source share

The System Path variable is too long. Copy the current text into notepad and delete duplicate entries and unnecessary names and copy back to the path variable.

0
May 2 '14 at 2:05
source share

In my case, this error was caused by an invalid key in the web.config file. Try to revert the latest changes to the file.

0
Aug 25 '15 at 16:05
source share

I had the same problem, but I realized that "connectionStrings" should be under "configSections" in the web.config file

0
Jun 18 '16 at 1:04 on
source share

This issue occurs because of the long path in your environment. The variable window of the variable supports only 2048 characters. To solve this problem, you need to remove several varibale variables from your system from PATH.

0
Jun 28 '16 at 11:31 on
source share



All Articles