Exception has been thrown by the target of an invocation

I had this weird error when I installed the web version of Microsoft Visual Studio on one of my live server. I was not able to access most of the applications. I tried to open the Environment variables and got an error that an exe is missing. There were no images for most of the applications like IIS manager on the task bar. The actual problem was that the path entry under environment variable has a limit of 2048 character. Once this limit is exceeded your environment variables stop working and system goes insane.

If you too are facing this issue follow the under given instructions:

  1. Go to the problematic system
  2. Open the registry editor
  3. Go to the path given in the below picture
  4. 7-path-variableb
  5. Go to path D-Word
  6. Open the Data field
  7. Remove few entries which are not required or can be removed
  8. Make sure the number of characters comes under 2048.
  9. Saved and close the registry and you will be good to go (There might be a restart required).

Leave a Comment

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