I wish to import an ActiveX Control into a Form. Ok, that's easy enough. Add
the Control and the wrappers:
AxInterop.MyControl.dll
Interop.MyControl.dll
..are created and all works ok.
Description - Strong Named Assembly
--------------------------------------------
If I wish to make the prject assembly strong named I need to Strong Name the
ActiveX Control. This is an ActiveX Control written by us so we should have
rights to do as we please. So we take the following step:
- Create a key with sn: MyKey.snk
- Aximp.exe MyControl.ocx /out:AxInterop.MyControl.dll /keyfile:MyKey.snk
That creates 2 dlls:
- AxInterop.MyControl.dll and MyControl.dll
The dlls may be used to overwrite the dlls automatically created when the
Control was originally dragged onto a Form. The new dlls are strong named
and the project compiles ok.
Problem:
-----------
The version for the Dlls id 1.0.0.0.
I wish the version to reflect the original version in the ocx (eg.2.0.1.0)
If I take the step:
tlbimp.exe MyControl.ocx /out:Interop.MyControl.dll /keyfile:MyKey.snk
/asmversion:2.0.1.0 /primary
..then the version is correct when brought in as reference to my
VisStudio.NET project. The problem is that doesn't create the AX wrapper
needed to embed the control in a Windows Form.
Question:
------------
Can anyone suggest how AxImp may be used with version applied as can be done
with TlbImp ?
Many thanks,
Marc Meumann
I don't know that you will like the answer to this, but it should work.
Considering that there is no option on the AxImp utilty to set the
version, what I would recommend doing is taking the assembly that is
produced by AxImp, and decompiling it to the IL (using ILDASM). Once you
have done this, you should modify the IL so that the AssemblyVersion
attribute has the assembly version that you want.
Once you do that, you can use ILASM to generate the assembly again from
the IL code.
Hope this helps.
--
- Nicholas Paldino [.NET MVP]
- nicholas...@exisconsulting.com
"Marc Meumann" <meu...@menta.net> wrote in message
news:ebS2Q7wNCHA.2528@tkmsftngp09...
Good suggestion, thanks. I'm making progress with that, a couple of hiccups
to iron out and I think it should work ok, the versioning aspect seems ok.
Best regards,
Marc Meumann
Steema Software SL
supp...@steema.com
"Nicholas Paldino [.NET/C# MVP]" <nicholas...@exisconsulting.com> wrote
in message news:#zkat#wNCHA.2404@tkmsftngp11...