Quantcast
Channel: Visual Studio Integrate forum
Viewing all articles
Browse latest Browse all 4410

My ErrorListProvider keeps being garbage collected

$
0
0

For some reason, the custom ErrorListProvider for my VS2008 add-in keeps being GC'd after I create it.  Sometime after OnStartupComplete is done.  Here is my code (modifed for space):

public class Connect : IDTExtensibility2, IDTCommandTarget
{

      private ServiceProvider MyServiceProvider;
      private ErrorListProvider ErrorProvider;    

      public void OnStartupComplete(ref Array custom)
      {

          // Initialize the Error List provider so we can add tasks
          MyServiceProvider = new ServiceProvider((Microsoft.VisualStudio.OLE.Interop.IServiceProvider)ApplicationObject);
          ErrorProvider = new ErrorListProvider(MyServiceProvider);
          ErrorProvider.ProviderName = "UDS Error Provider";
          ErrorProvider.ProviderGuid = new Guid(ERROR_PROVIDER_GUID);
          ErrorProvider.Show();

      }

}

 

When I go to use it later on via a command via Exec() ErrorProvider is null.  Does anyone have an idea why it might be getting GCd.


Viewing all articles
Browse latest Browse all 4410

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>