Ver versión en español    
 
Home
10 Reasons to use MZ-Tools
MZ-Tools 6.0 for VS.NET
Editions
Features
Online Documentation
MZ-Tools SDK
Download
Purchase
Version History (RSS)  
FAQ & Support
MZ-Tools 3.0 for VB6 & VBA
Features
Online Documentation
Download (freeware)
Donations (Paypal)
Version History (RSS)  
FAQ & Support
User Reviews
Community Place
Contact  
For Add-In Developers
About
   
 
User Testimonials

I'm an avid supporter of MZ-Tools. It's a product I couldn't do without and your level of support is outstanding.

Jan Hyde (Visual Basic MVP)

You will soon wonder how you ever lived without it.

Andy Maggs

More user reviews
 
BUG: Infinite recursion in add-in causes Visual Studio crash.

Author: Carlos J. Quintero (Microsoft MVP) Applies to: Microsoft Visual Studio 2005
Date: March 2009   Microsoft Visual Studio 2008
       
Introduction

When an add-in enters in an infinite recursion, it crashes Visual Studio.

Cause

This is a bug introduced in Visual Studio 2005. It didn't happen in Visual Studio .NET 2003 (in this IDE the exception was intercepted by Visual Studio and shown in a friendly message box without crashing).

More Information

Steps to reproduce the problem:

  • Create a Visual Studio 2005/2008 add-in with this code and load it:
Language: VB.NET   Copy Code Copy Code (IE only)
Public Class Connect
   Implements IDTExtensibility2

   Public Sub OnConnection(ByVal application As Object, ByVal connectMode As ext_ConnectMode, _
      ByVal addInInst As Object, ByRef custom As Array) Implements IDTExtensibility2.OnConnection

      Call f1()

   End Sub

   Private Sub f1()

      Call f1()

   End Sub

   Public Sub OnDisconnection(ByVal disconnectMode As ext_DisconnectMode, ByRef custom As Array) _
      Implements IDTExtensibility2.OnDisconnection
   End Sub

   Public Sub OnAddInsUpdate(ByRef custom As Array) Implements IDTExtensibility2.OnAddInsUpdate
   End Sub

   Public Sub OnStartupComplete(ByRef custom As Array) Implements IDTExtensibility2.OnStartupComplete
   End Sub

   Public Sub OnBeginShutdown(ByRef custom As Array) Implements IDTExtensibility2.OnBeginShutdown
   End Sub

End Class
Language: C#   Copy Code Copy Code (IE only)
public class Connect : IDTExtensibility2
{
   public void OnConnection(object application, ext_ConnectMode connectMode, object addInInst, ref Array custom)
   {
      f1();
   }

   private void f1()
   {
      f1();
   }

   public void OnDisconnection(ext_DisconnectMode disconnectMode, ref Array custom)
   {
   }

   public void OnAddInsUpdate(ref Array custom)
   {
   }

   public void OnStartupComplete(ref Array custom)
   {
   }

   public void OnBeginShutdown(ref Array custom)
   {
   }
}

Go back to the 'Resources for Visual Studio .NET extensibility' section for more articles like this


MZ-Tools 6.0 for Visual Studio .NET

You can code, design, locate code and document your apps much faster using VB.NET, C#, C++ or Visual J#:

Buy MZ-Tools Now Download MZ-Tools Demo

   Top