I know it is not register properly for two reasons:
1) If i go to DOS and I do Regasm "MyDll" -u the unregistration fail (Subkey
does not exist).
2) I know that the registration failed at setup because my assembly is used
by a GIS software called ArcMap. When I register my assembly with regasm
/codebase I can execute my functions in the GIS. If I simply run the Setup
program the functions are not available.
I may have found something. When I go to the DOS prompt to call Regasm
/codebase the registration succeed, my functions runs in the GIS and they
works fine. But, I build an exe to register my dll automatically (see code
below) and the registration failed. The error is "File or assembly name
ADependentDLL, or one of its dependencies, was not found." I don't know why
I get this error because like I said it works with Regasm ?
So, probably my setup doesn't register my dll correctly because of the same
error and no errors are returned ? Why do I get this error with
System.Runtime.InteropServices.RegistrationServices and not Regasm.exe ???
Try
Path As String = "C:\Program Files\MyApp\Inventaire.dll" 'This path is
ok 100% sure.
Dim InstallingAssembly As System.Reflection.Assembly
InstallingAssembly = System.Reflection.Assembly.LoadFile(Path) 'This
line runs ok i put a msgbox that returns the Fullname of the assembly.
Dim Outil As New System.Runtime.InteropServices.RegistrationServices
Outil.RegisterAssembly(InstallingAssembly,
Runtime.InteropServices.AssemblyRegistrationFlags.SetCodeBase) 'This line
failed.
Catch
MsgBox(Err.Description)
End Try
Thanks,
David
"Phil Wilson" <phil.wilson@unisys.spamcom> a écrit dans le message de
news:%2395Anm1FEHA.3324@TK2MSFTNGP09.phx.gbl...
[quoted text, click to view] > It looks like you're doing the right thing with the setup project. How do
you
> know it's not registered properly? Can you see incorrect registry entries?
Are
> you getting an HRESULT you can report?
> --
> Phil Wilson [MVP Windows Installer]
> ----
> "David-L. Nadeau" <d_l_n@hotmail.com> wrote in message
> news:eM1hY%230FEHA.3132@TK2MSFTNGP12.phx.gbl...
> > Hi!
> >
> > I have build a setup project in VS 2003. I've setup my project to
register
> > my assembly for COM. Interop. In my setup project I set register to
> > vsdrpCOM. Unfortunately, when i deploy my application the dll is not
> > register correctly in the registry. I have to regsiter it manually by
doing
> > regasm "MyDll.dll" /codebase in order to make it visible as a COM
object.
> >
> > What am I doing wrong ?
> >
> > How can I register and unregister my assembly as a COM object
automaticly at
> > deployment ?
> >
> > Thanks,
> >
> > David
> >
> >
>
>