I need to load and unload dynamically a .dll (assembly previouly created) into a newly domain.
I've read many things concerning the appdomain class and assembly class. I've build a little app to show you my problem.

Here are the code for the plugin.dll assembly :

Public Class test
Public Sub New()
'
End Sub

Public Sub DoJob()
' Do some work
End Sub
End Class

Here are the code for the test.exe console assembly :

Imports System.Reflection

Module Module1
Private mPluginDomain As AppDomain
Private moObjectInterface As Object

Sub Main()
Dim a As [Assembly]

mPluginDomain = AppDomain.CreateDomain("Domain_plugin.test", _
AppDomain.CurrentDomain.Evidence, _
AppDomain.CurrentDomain.SetupInformation)

a = mPluginDomain.Load("plugin")
moObjectInterface = a.CreateInstance("plugin.test")
a = Nothing

moObjectInterface.dojob()
moObjectInterface = Nothing

AppDomain.Unload(mPluginDomain)
mPluginDomain = Nothing

MsgBox("end")
End Sub
End Module

Here are the resulting log :

...
'Domain_plugin.test' : chargé 'c:\temp\tst\bin\plugin.dll', symboles chargés.
'tst.exe' : chargé 'c:\temp\tst\bin\plugin.dll', symboles chargés.
...

Everything works ... exept one thing ! The plugin.dll is loaded twice ! One in the remote domain, and one in the default appdomain. The result is that I can't update my plugin.dll with a new code because the file is still use by the process.

Can someone help me resolving this problem ?

PS : Sorry for my bad english !