Getting TargetInvocationException

Aug 4, 2009 at 9:40 AM

Hi there,

SPVisualDev was working fine and suddenly today I get this exception message after the feature is being activated or installed or uninstalled or deactivated

System.Reflection.TargetInvocationException    at System.DirectoryServices.DirectoryEntry.Invoke(String methodName, Object[] args)
   at SPVisualDev.Connect.RecycleIISAppPools()
   at SPVisualDev.Connect.ActivateDeactivateFeature(ProjectItem FeatureFolderItem, Int32 Action)
   at SPVisualDev.Connect.Exec(String commandName, vsCommandExecOption executeOption, Object& varIn, Object& varOut, Boolean& handled)

Any help would be much appreciated.



Aug 6, 2009 at 9:22 AM

I got the same problem as you today.

It happend because i had one application pool in IIS turned off.
Maybe thats what's causing your troubles.

Regards, Andreas

Aug 7, 2009 at 6:46 AM

Hi Andreas,

Thanks for the reply! You are right! I had one of my app pools turned off! Once I started it, its all working fine now.

Wonder, if this is a bug?



Aug 9, 2009 at 10:56 PM

After further investigation i discovered that the routine that does the IIS recycle recyles all appl pools no matter if they are used in SharePoint or not. It doesnt even check if they are stopped or invalid. This is considered a bug and should be fixed in the next release.

The method responsible for iis recycling is private void RecycleIISAppPools() found in class Connect.cs,


I'll make this an issue

Thanks Andreas and Chaks


Aug 12, 2009 at 4:54 AM

Thanks Tony :)