title: How to preserve COM DLL version in an auto-generated interop assembly in VS2005?
body: <p>I've added a reference to a co-worker's COM DLL -- MyLogic.dll -- to my C# project in Visual Studio 2005. As expected, this auto-generates Interop.MyLogicLib.dll in my output folder. However, the version number of the COM DLL is 2.1.0.180, whereas the version number of the auto-generated interop assembly is 1.0.0.0. How do I get Visual Studio to preserve the original version number?</p>
  
  <p>As it stands, the 1.0.0.0 version number is giving me grief in my product's installation. The installer refuses to overwrite earlier versions of the interop DLL because both old and new copies have the 1.0.0.0 version.</p>
  
  <p>Incidentally, I've tried using "tlbimp /asmversion:2.1.0.180 MyLogic.dll" to manually generate the assembly at the command line, but:</p>
  
  <ol>
  <li>My project refuses to build with the manually-generated assembly, saying that the types I'm using are defined in an unreference assembly called Interop.MyLogicLib.dll (the one I'm making manually doesn't have the "Interop." prefix). Have to admit, I don't understand this.</li>
  <li>I need to know the version number in advance, instead of having a tool read it from the COM DLL</li>
  <li>It's a manual process, which sucks</li>
  </ol>
  
  <p>Anyway, surely Visual Studio can <em>automatically</em> copy across the COM version number?</p>
  
  <p><strong>Update:</strong> Apologies; I appear to have duplicated <a href="https://stackoverflow.com/questions/41832/maintain-the-correct-version-for-a-com-dll-referenced-in-a-net-project">another question</a>. I did search for an existing one first, honest. I just missed it. :(</p>