Context 0x1b64e0' is disconnected : DirectoryEntry

I started getting the exception below everytime I close my application.To fix this I had to either dispose the directory entry object after calling the ProcessDirectoryEntry in the for loop OR change "byval" to "byref" in the ProcessDirectoryEntry de parameter.

 For Each de As DirectoryEntry In delist
    ''fix - de.dispose
Sub ProcessDirectoryEntry(ByVal de As DirectoryEntry)
End Sub

Context 0x1b64e0' is disconnected.  Releasing the interfaces from the current context (context 0x1b6370). This may cause corruption or data loss. To avoid this problem, please ensure that all contexts/apartments stay alive until the application is completely done with the RuntimeCallableWrappers that represent COM components that live inside them.


Popular posts from this blog

Duplicate Folders Freeware - Not Duplicate Files

SSRS Compile Errors

Free SQL Server Management Studio Addin/Plugin/External Tool to get object information quickly