title: RegAsm regfile switch not giving same output as codebase switch
body: <p>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<br></p>
  
  <p>According to MSDN :<br>
  The <code>/regfile</code> switch "Generates the specified .reg file for the assembly"<br>
  The <code>/codebase</code> switch "Creates a Codebase entry in the registry specifiying the file path for an assembly"</p>
  
  <p>I guessed that it was 2 different ways of doing the same stuff. Truth was, I was wrong : </p>
  
  <p><strong>METHOD 1</strong></p>
  
  <pre><code>C:\&gt;"C:\Windows\Microsoft.NET\Framework\v4.0.30319\RegAsm.exe" "C:\SERVER.dll" /regfile
  Registry script 'C:\SERVER.reg' generated successfully
  </code></pre>
  
  <p>Reg File output : </p>
  
  <pre><code>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}]
  </code></pre>
  
  <p><strong>METHOD 2</strong></p>
  
  <p>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)</p>
  
  <pre><code>C:\&gt;"C:\Windows\Microsoft.NET\Framework\v4.0.30319\RegAsm.exe" "C:\SERVER.dll" /codebase
  Types registered successfully
  </code></pre>
  
  <p>Registry ouptut with codebase : </p>
  
  <pre><code>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"
  </code></pre>
  
  <p><br><br><br>
  As you can notice, stuff is now in the <strong>Wow6432Node</strong> and infos are much more comprehensive (notably CodeBase !!!)</p>
  
  <p>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</p>