Whenever you're trying to convert a VB6 or Classic ASP application to .NET with the Visual Basic Upgrade Companion it is recommended that you do so in an environment where the source application can be built and executed. This will ensure all the required references are correctly registered in that environment.
If the code to be migrated can be compiled, most likely VBUC will automatically resolve all the references for the application.
Sometimes, however, VBUC will still show some errors in the "Resolve References" tab:
This can happen when the environment is incomplete (and probably the source application hasn't been compiled) or because the reference is not really used in the application, even though it is still present in the VBP list of references.
There are three ways to overcome this:
- Ensure the source application can be compiled. This might require installing the third party component or simply registering it.
After this is done, click the "Analyze References" button in the VBUC ribbon.
This is the recommended approach.
- Manually fix the reference.
If you right-click on the invalid reference you will have the option to "Set reference manually", where you can browse your file system to find the missing binary.
This can be useful if you don't have access to a full build environment and the missing component is not compatible with the current operating system (some ActiveX aren't compatible with newer versions of Windows).
It's important to note that this will likely not generate the optimal code and should be used only if the referenced component will be replaced as part of the manual work for the migration.
- Remove the reference.
This can be done if the component is not really used and is a remnant of some previous version of the application or someone added it by mistake or for testing purposes.
You can re-open the project in VB6 and remove the reference (alternatively you can do it by modifying the VBP file with a text editor).
- Use the "expert" GUI mode in VBUC.
With this option, VBUC will allow you to continue with the migration even when some components are missing. This might be useful if you're trying to do just a quick evaluation and have many missing references.
This is not recommended when you intend to use the resulting code. It will likely generate sub-optimal code and require additional manual work for any components not resolved.
The expert mode can be enabled by opening VBUC settings file with a text editor. The file is located in %appdata%\Mobilize.Net\VBUC\VBUM.Settings.xml
Once opened, find the line <GUIMode>normal</GUIMode> and replace "normal" with "expert". Save the file and re-launch VBUC.
This will remove the restriction of having to resolve the references and instead of this message:
You'll now get this one:
Allowing you to continue the migration, even with missing references.
Hopefully this will help you with your evaluation process.
Remember though, the best code will be generated when the source application is complete, including any required third-party component.