title: Error referencing DLL in C# "A reference to xxx.DLL could not be added
body: <p>I am trying to reference a DLL in a C# application. The DLL has been written in C++. To make the reference I am right-clicking on the "references" section on the solution explorer and choosing "Add Reference" and then browsing to it. Every time I try, I get an error message</p>
  
  <blockquote>
    <p>A reference to xxx.DLL could not be added. Please make sure that the
    file is acessible, and that it is a valid assembly or COM component.</p>
  </blockquote>
  
  <p>Having done some googling, I noted that many people suggest using TlbImp.exe to get a valid DLL, but when I run it at the command line, I get,</p>
  
  <blockquote>
    <p>TlbImp:error TI0000 : The input file xxx.dll is not a valid type
    library.</p>
  </blockquote>
  
  <p>It did occur to me that the DLL in question might just be badly written (the chap who wrote it is now on holiday) so I worked through <a href="https://msdn.microsoft.com/en-GB/library/ms235636.aspx" rel="nofollow noreferrer">this</a> microsoft walkthrough to create a new, very simple dll, and I got the same result.</p>
  
  <p>I am using VS2015, although I did previously have an install of VS2013 Express. I also tried the same process on another machine with VS2013 and VS2010. The effects were the same.</p>
  
  <p>Does anyone have any ideas?</p>