Ok, I know this is pretty specific, but I lost my whole working day on it so I really need some rational explanation to it, so my boss and my wife wouldn't fire me
According to MSDN :
The /regfile
switch "Generates the specified .reg file for the assembly"
The /codebase
switch "Creates a Codebase entry in the registry specifiying the file path for an assembly"
I guessed that it was 2 different ways of doing the same stuff. Truth was, I was wrong :
METHOD 1
C:\>"C:\Windows\Microsoft.NET\Framework\v4.0.30319\RegAsm.exe" "C:\SERVER.dll" /regfile
Registry script 'C:\SERVER.reg' generated successfully
Reg File output :
REGEDIT4
[HKEY_CLASSES_ROOT\xfeed.server.X]
@="SERVER.XLS"
[HKEY_CLASSES_ROOT\xfeed.server.X\CLSID]
@="{8F4A5B5E-8DD7-30A3-993F-18C7E2C457CF}"
[HKEY_CLASSES_ROOT\CLSID\{8F4A5B5E-8DD7-30A3-993F-18C7E2C457CF}]
@="SERVER.XLS"
[HKEY_CLASSES_ROOT\CLSID\{8F4A5B5E-8DD7-30A3-993F-18C7E2C457CF}\InprocServer32]
@="mscoree.dll"
"ThreadingModel"="Both"
"Class"="SERVER.XLS"
"Assembly"="SERVER, Version=1.0.0.0, Culture=neutral, PublicKeyToken=6e3de07ee666a5f5"
"RuntimeVersion"="v2.0.50727"
[HKEY_CLASSES_ROOT\CLSID\{8F4A5B5E-8DD7-30A3-993F-18C7E2C457CF}\InprocServer32\1.0.0.0]
"Class"="SERVER.XLS"
"Assembly"="SERVER, Version=1.0.0.0, Culture=neutral, PublicKeyToken=6e3de07ee666a5f5"
"RuntimeVersion"="v2.0.50727"
[HKEY_CLASSES_ROOT\CLSID\{8F4A5B5E-8DD7-30A3-993F-18C7E2C457CF}\ProgId]
@="xfeed.server.X"
[HKEY_CLASSES_ROOT\CLSID\{8F4A5B5E-8DD7-30A3-993F-18C7E2C457CF}\Implemented Categories\ {62C8FE65-4EBB-45E7-B440-6E39B2CDBF29}]
METHOD 2
But when I execute the codebase switch command directly rather that using the reg file, the keys impacted in the regsitry are different (and work, on the contrary of the preceding output)
C:\>"C:\Windows\Microsoft.NET\Framework\v4.0.30319\RegAsm.exe" "C:\SERVER.dll" /codebase
Types registered successfully
Registry ouptut with codebase :
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Wow6432Node\CLSID\{8F4A5B5E-8DD7-30A3-993F-18C7E2C457CF}]
@="SERVER.XLS"
[HKEY_CLASSES_ROOT\Wow6432Node\CLSID\{8F4A5B5E-8DD7-30A3-993F-18C7E2C457CF}\Implemented Categories]
[HKEY_CLASSES_ROOT\Wow6432Node\CLSID\{8F4A5B5E-8DD7-30A3-993F-18C7E2C457CF}\Implemented Categories\{62C8FE65-4EBB-45e7-B440-6E39B2CDBF29}]
[HKEY_CLASSES_ROOT\Wow6432Node\CLSID\{8F4A5B5E-8DD7-30A3-993F-18C7E2C457CF}\InprocServer32]
@="mscoree.dll"
"ThreadingModel"="Both"
"Class"="SERVER.XLS"
"Assembly"="SERVER, Version=1.0.0.0, Culture=neutral, PublicKeyToken=6e3de07ee666a5f5"
"RuntimeVersion"="v2.0.50727"
"CodeBase"="file:///C:/SERVER.DLL"
[HKEY_CLASSES_ROOT\Wow6432Node\CLSID\{8F4A5B5E-8DD7-30A3-993F-18C7E2C457CF}\InprocServer32\1.0.0.0]
"Class"="SERVER.XLS"
"Assembly"="SERVER, Version=1.0.0.0, Culture=neutral, PublicKeyToken=6e3de07ee666a5f5"
"RuntimeVersion"="v2.0.50727"
"CodeBase"="file:///C:/SERVER.DLL"
[HKEY_CLASSES_ROOT\Wow6432Node\CLSID\{8F4A5B5E-8DD7-30A3-993F-18C7E2C457CF}\ProgId]
@="xfeed.server.X"
As you can notice, stuff is now in the Wow6432Node and infos are much more comprehensive (notably CodeBase !!!)
If anyone could give me a rational reason to this, so I could avoid mentioning paranormal activity as a cause for a lost working day, I would be very grateful