msorens
2009-06-22 23:10:02 UTC
I am calling a .NET application via a COM interface from Ruby. This has
worked fine for a long time with this simple installation procedure:
(1) Compile project on development machine.
Then on target machine:
(2) Remove existing version of dll from \Windows\Assembly.
(2) Drag-and-drop dll file to \Windows\Assembly.
(3) Run "Regasm.exe MyObj.dll /tlb:MyObj.tlb".
(4) Check with this test program:
------------------------------
require 'win32ole'
my_driver = WIN32OLE.new('MyObj.MyClass')
------------------------------
I have repeated this procedure on the same target machine frequently.
Usually I will increment the file and assembly version numbers before I
compile a fresh dll. The only thing unique about this time--when the
procedure failed--is that I am attempting to use an older version of the dll
(that is, I am trying to load version 2009.5.29.1 after I have had
2009.6.19.4 successfully installed).
The error on the command line is this:
failed to create WIN32OLE object...
HRESULT error code:0x80070002
The system cannot find the specified file.
The Assembly Binding Log Viewer (fuslogvw) reveals why this is occurring:
the system is trying to load the newer version (2009.6.19.4). It thus reports
the GAC lookup is unsuccesful, since I now have version 2009.5.29.1 in the
GAC.
I thought that if I remove it from the GAC (deleting from \Windows\Assembly)
and re-execute regasm, all traces of the previously installed version should
be gone. So where else does it know about the previous version from and how
do I properly clean up when I do a new install?
worked fine for a long time with this simple installation procedure:
(1) Compile project on development machine.
Then on target machine:
(2) Remove existing version of dll from \Windows\Assembly.
(2) Drag-and-drop dll file to \Windows\Assembly.
(3) Run "Regasm.exe MyObj.dll /tlb:MyObj.tlb".
(4) Check with this test program:
------------------------------
require 'win32ole'
my_driver = WIN32OLE.new('MyObj.MyClass')
------------------------------
I have repeated this procedure on the same target machine frequently.
Usually I will increment the file and assembly version numbers before I
compile a fresh dll. The only thing unique about this time--when the
procedure failed--is that I am attempting to use an older version of the dll
(that is, I am trying to load version 2009.5.29.1 after I have had
2009.6.19.4 successfully installed).
The error on the command line is this:
failed to create WIN32OLE object...
HRESULT error code:0x80070002
The system cannot find the specified file.
The Assembly Binding Log Viewer (fuslogvw) reveals why this is occurring:
the system is trying to load the newer version (2009.6.19.4). It thus reports
the GAC lookup is unsuccesful, since I now have version 2009.5.29.1 in the
GAC.
I thought that if I remove it from the GAC (deleting from \Windows\Assembly)
and re-execute regasm, all traces of the previously installed version should
be gone. So where else does it know about the previous version from and how
do I properly clean up when I do a new install?