VB Migration Partner

KNOWLEDGE BASE - General


Previous | Index | Next 

[HOWTO] Create references to .NET assemblies with absolute path

By default, the all .NET projects that VB Migration Partner creates are “self-contained”, in the sense that their folder contain all the assemblies that are required for a correct compilation and execution. Such referenced assemblies – including VB Migration Partner’s support libraries and .NET libraries that you have converted previously – are stored in a subfolder named SupportDLLs. This arrangement allows you, for example, to perform XCOPY installation of migrated project to a different computer.

While the default behavior is fine in most cases, the fact that each project comes with a distinct set of (duplicated) DLLs can be a source of problems. In addition to disk usage waste, all these duplicated DLLs need to be manually updated if you rebuild the original assembly or if you installa a newer version of VB Migration Partner’s support libraries.

You can change the default behavior by including an AddLibraryPath pragma, like the following:

        '## AddLibraryPath "c:\NetPrograms\Converted DLLs"

The previous pragma affects VB Migration Partner’s in two ways. First, it searches the specified folder for any DLL that is the result of a conversion from VB6 – more specifically, any DLL that contains a VB6SupportLibrary attribute at the assembly level. Second, if the project being converted references a DLL found in this folder, then the assembly reference is made directly to the original DLL and the referenced DLL is not copied to the SupportDLLs folder.

Even if VB Migration Partner’s is always able to locate its own support libraries – which are stored in VB Migration Partner’s installation folder – you might want to copy these support libraries to another folder and use an AddLibraryPath pragma that points to that folder:

        '## AddLibraryPath "c:\NetPrograms\Support DLLs"

The neat effect of this pragma is that projects converted by VB Migration Partner will reference assemblies in the specified folder and won’t create a SupportDLLs subdirectory inside the project’s folder.

Keep in mind that AddLibraryPath pragmas can only be stored inside a *.pragmas file, either in the same directory as the VB6 project being migrated or in the “master” VBMigrationPartner.pragmas file inside VB Migration Partner’s installation folder. Using the latter file is a convenient way to specify an alternate location for the support libraries that are required by all migrated projects.

Previous | Index | Next 




Follow Francesco Balena on VB6 migration’s group on

LinkedIn





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.

newsletter



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