Click here to Skip to main content
15,886,857 members
Articles / Programming Languages / Visual Basic
Tip/Trick

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

Rate me:
Please Sign up or sign in to vote.
2.50/5 (3 votes)
3 May 2012CPOL1 min read 15.9K   2  
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, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Product Manager
India India
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
-- There are no messages in this forum --