Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles
(untagged)

Migrating VB Project (which are using .tlb references) to VB.NET (yellow exclamation mark error in references)

0.00/5 (No votes)
3 May 2012 1  
Migration of a VB project which is using .tlb refrences, to VB.NET

Introduction

It is a very common problem faced by developers working on VB to VB.NET migration project. If VB6 project is using some DLLs which are further referencing .TLBs (type libraries), then this VB6 project cannot directly be migrated to VB.NET using upgrade wizard. It will not create InterOps for those DLLs which are using .TLBs.

Background

While working on a migration project, I faced an issue that I was not able to add a DLL reference to my converted (from VB6 to VB.NET) .NET solution. Ideally conversion wizard automatically makes the InterOps for the DLLs being referred in VB6 project. In my case, it was showing that DLL in my solution but a yellow exclamation mark on it.

Steps

In order to resolve this issue, one can follow the steps given below:

  1. Check for the references in your VB6 project and note down the .tlb references and their locations.
  2. Go to the location "C:\WINDOWS\system32\URTTEMP" at command prompt and execute "regtlib.exe" along with the .tlb name with full path.
    e.g. C:\WINDOWS\system32\URTTEMP>regtlib C:\TestFolder\test.tlb
    In the above example, my .tlb file name is test.tlb and placed at location "C:\TestFolder". This command will register the .tlb file
  3. Recompile your VB6 DLL.
  4. Now add the reference of this newly compiled DLL into your VB.NET solution.

It will now create the InterOp for your VB6 DLL automatically.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here