VB Migration Partner


Previous | Index | Next 

[PRB] Errors when doing unit testing or using reflection to explore the support library

If you use the Test Wizard included in Visual Studio to create unit tests for a .NET project generated by VB Migration Partner, the following exception occurs:

The following error was encountered while reading module 'CodeArchitects.VBLibrary': 
Assembly reference not resolved: InetCtlsObjects, Version=, Culture=neutral, 

This exception occurs also when a .NET application – either converted from VB6 or created from scratch – attempts to enumerate all the types in the CodeArchitects.VBLibrary.dll assembly. (Which, in fact, this is exactly what the Test Wizard attempts to do when generating unit tests.)

To understand why this exception occurs, you should keep in mind that the CodeArchitects.VBLibrary assembly includes a few classes which depend on external libraries. Most notably, the wrapper classes for the following controls depend on ancillary DLLs that have been installed in VB Migration Partner’s main folder:

  • Data (DAO.DLL)
  • INet  (InetCtlsObjects.dll)
  • MAPIMessages, MAPISession (MSMAPI.DLL)
  • MSComm (MSCommLib.dll)
  • RDO Data (RDO.DLL)
  • ScriptControl (MSScriptControl.dll)

In addition, a few other classes – e.g. the DataEnvironment and the ADO Data control - depend on the adodb.dll assembly that is installed in the GAC when you install Visual Studio, or the complete .NET Framework SDK.

If the original VB6 project uses one of these controls, VB Migration Partner dutifully copies the corresponding DLL into the .NET project’s folder, else the migrated project could not run correctly.

However, if an external .NET application – including the Test Wizard – uses reflection to explore all the types found in the CodeArchitects.VBLibrary assembly, then the six DLLs listed above are necessary and should be copied in the Bin/Debug (or Bin/Release) folder of the migrated .NET project.

In addition, if you are running the code on a computer where neither Visual Studio nor the .NET Framework SDK is installed, then you should adodb.dll in the list of files to be copied.

Previous | Index | Next 

Follow Francesco Balena on VB6 migration’s group on


Read Microsoft Corp’s official case study of a VB6 conversion using VB Migration Partner.

Code Architects and its partners offers remote and onsite migration services.

More details

Subscribe to our free newsletter for useful VB6 migration tips and techniques.


To learn more about your VB6 applications, run VB6 Analyzer on your source code and send us the generated text file. You will receive a detailed report about your VB6 applications and how VB Migration Partner can help you to quickly and effectively migrate it to .NET.

Get free advice

A fully-working, time-limited Trial Edition of VB Migration Partner allows you to test it against your actual code

Get the Trial

The price of VB Migration Partner depends on the size of the VB6 application, the type of license, and other factors

Request a quote

Migrating a VB6 application in 10 easy steps

Comparing VB Migration Partner with Upgrade Wizard

Migration tools: Feature Comparison Table

All whitepapers