To complete the Visual Basic to .NET upgrade process, you may need to revise some aspects of the application to guarantee a smooth experience for the end user. This chapter will guide you through these revisions, accurately explaining how to separate the VB .NET assembly, the procedure to upgrade the VB help file, and how to deal with the upgraded VB .NET application setup and deployment, among others.
In Visual Basic .NET, what is an assembly?
An assembly is the primary building block of a .NET Framework application. It is a component library that is built, versioned, and deployed as a single implementation unit. Every assembly contains a manifest, which describes that assembly.
What happens if an application or component is implemented as a single assembly but the components have low cohesion?
In these cases, the development, deployment and support aspects can be negatively affected. This can result in serious deployment problems if parts of the application are modified and new versions of those parts need to be installed. Visual Basic 6.0 supported this type of organization because it allowed the developer to define only a single user class per file. Visual Basic .NET supports having more than one class per assembly, which allows developers to create groups of related classes with high cohesion.
What is the main reason to separate assemblies by tier?
Small and medium-size projects can have components organized into assemblies that correspond to each of the application tiers. Assembly separation by tier is a natural consequence of the physical separation between the different application tiers.
The main reason is the size and complexity of the assembly. If an assembly is large and some of its functionality is rarely used, the assembly can be divided according to functional layers. You should consider locating the presentation tier, business logic, and data access layers in the same assembly if doing so will ease deployment and systems management concerns.
In which cases should I separate VB .NET assemblies by functionality?
When the complexity of an application increases, you should organize assemblies into functional groups. A functional separation is useful from a design perspective because it allows developers to build new functionality based on blocks that operate at the same conceptual level as the new features. For example, the business logic and the data access functionality can be grouped into a single assembly that would be shared by multiple applications.
Can the Visual Basic Upgrade Wizard automatically migrate the Help system in a Visual Basic 6.0 application?
No. The Upgrade Wizard leaves the HelpFile property (used to specify the name and location of the Help document) and the HelpContextID properties (used to associate a specific topic in the Help file for each control on your forms) unchanged. In addition, the Upgrade Wizard generates a compilation error for each occurrence of these properties because of changes in the Help system in Visual Basic .NET.
What kind of help does the Visual Basic .NET HelpProvider class provide for controls?
The VB .NET HelpProvider class provides Help for controls by extending their properties to the following:
- The HelpKeyword property provides the key information to retrieve the Help associated with this control from the Help file specified by HelpNamespace.
- The HelpNavigator property specifies the Help command to use when retrieving Help from the Help file for the specified control.
- The HelpString property specifies the string associated with the specified control.
- The ShowHelp property specifies whether Help is displayed for the specified control.
How should I proceed if my existing Help project is based on a Windows Help project?
Visual Basic .NET supports the HTML Help format only. Therefore, if your existing Help project is based on a Windows Help project (a .hpj file), you must change it before you upgrade the source code.
How can I implement context-sensitive (pop-up) Help in my Visual Basic .NET application?
You can do this by using the WhatsThisButton and WhatsThisHelp properties of a form. The What’s This button appears when you set these properties to True and you set the following properties to the specified values:
- Set the ControlBox property to True.
- Set the BorderStyle property to Fixed Single or Sizable.
- Set the MinButton and MaxButton to False, or set the BorderStyle property to Fixed Dialog.
What are the three main categories of required files for Visual Basic 6.0 applications?
Run-time files. These are files an application must have to work correctly after installation. All Visual Basic 6.0 applications require these files. The following are the run-time files for Visual Basic projects: Msvbvm60.dll, Stdole2.tlb, Oleaut32.dll, Olepro32.dll, Comcat.dll, Asycfilt.dll, and Ctl3d32.dll.
- Setup files. These files are required to set up a standard application on the end user’s computer. These include the setup executables (Setup.exe and Setup1.exe), the setup file list (Setup.lst), and the uninstall program (St6unst.exe).
- Application-specific files. These are files that are specific to your application that must be present for the application to run. These files include the application executable file, any data files, and any ActiveX controls used in the application.
These also include other files that your project depends on, such as the library and other files used by the ActiveX controls that your application contains.
What is the function of the Setup and Deployment option in Visual Basic .NET?
Setup and Deployment projects is a new project type in VB .NET that allows you to create Windows installers or CAB files to distribute your applications.
The process of using the Setup and Deployment Projects option to create installers is easiest when you have used a Visual Basic 6.0 setup project to create installers without making any customizations to the resulting installer. For simple projects that require no customization in deployment, you need only indicate the executable files and the product name in the deployment project. However, if your original project’s installer required customization, such as adding additional dialog boxes or changing standard dialog text, then you will need to perform similar customization when you use Setup and Deployment Projects.
What editors can I use in Visual Basic .NET to customize the application installer?
The editors available at Visual Studio .NET for applying changes and meeting the deployment requirements of an application are the following:
- File System Editor. This allows you to specify installation directories and Start menu and desktop items.
- Registry Editor. This allows you to specify registry keys and values to be added to the target computer during installation.
- File Types Editor. This allows you to specify the file type associations for the application on the target computer, as well as the verbs used to identify possible actions for those file types.
- User Interface Editor. This allows you to add more dialog boxes to your installation process.
- Custom Actions Editor. This allows you to specify additional actions to be performed during installation.
- Launch Conditions Editor. This allows you to specify conditions necessary on the target computer before the installation can begin.
What are some examples of predefined user interface dialog boxes provided by the User Interface Editor?
Some of the available dialog boxes that you can add are the following:
- Checkboxes. These dialog boxes present up to four choices to the user and returns the values of those choices during installation.
- Confirm Installation. This dialog box gives the user a chance to cancel installation or to go back to earlier dialog boxes and make changes before installation begins.
- Customer Information. This dialog box prompts the user for information such as name, company or organization, and product serial number.
- Finished. This dialog box notifies the user when the installation is complete.
- Installation Address. This dialog box allows the user to choose a Web locationwhere application files will be installed.
What is a .NET merge module and when should I create one?
A merge module (.msm) is a single package that includes all files, resources, registry entries, and setup logic to install shared files. Merge modules allow you to install components that are shared by multiple applications, such as the COM projects.
The merge modules are Setup and Deployment project options available in Visual Studio .NET that you can add to your solution. Anything that can only be used by a developer, such as .dll files, controls, resources, and components, should be packaged into a merge module. This module can later be included in a Windows Installer for distribution to the end user.
How can I manually add a Visual Basic 6.0 merge file?
- In the Solution Explorer, select the Setup project.
- On the Project menu, select the Add option, followed by the Merge Module option.
- In the Add Modules dialog box, search for Visual Basic 6.0 merge module, Msvbvm6.msm. By default, this module should be installed in the \Program Files\ Common\Merge Modules directory. If you do not have the file on the system, you can download it from “Windows Installer Merge Modules” in the Microsoft Visual Studio Developer Center on MSDN. After you have selected the file, click the OK button.
What are the main properties provided by the File System Editor?
The main properties that the File System Editor provides are the following:
- Virtual Directory. This property maintains the name of the target Web site.
- Port. This property specifies the number of the port to which the Web site responds.
- AllowDirectoryBrowsing. This property specifies whether the target Web directory can be browsed.
- ExecutePermissions. This property specifies the execution mode of the target Web site.
- IsApplication. This property specifies whether it is necessary to create an application for the target Web site.
When using the Component Services administrative tool, what COM+ application installation tasks may I need to perform?
These are some examples:
- Create a new COM+ application. To perform this procedure, you must be a member of the Administrator role on the target computer’s system application.
- Export COM+ server applications. You can use the Component Services administrative tool to export a COM+ server application for installation on one or more other server computers. For example, you can use the Component Services administrative tool to export a COM+ application from a staging computer, on which the application was developed and tested, to a production computer at an individual site.
- Install COM+ server applications. You can install a COM+ application by using the COM+ Application Install Wizard, or by dragging an application file from Windows Explorer to the details pane of the Component Services administrative tool while the COM+ Applications folder of a computer is open.
What are some important aspects that should be considered when evaluating deployment options?
The first thing is the performance of the invocations. Calls between different processes are expensive compared with calls within the same process. Another aspect to consider is the security verification performed during component invocations. Security credentials are verified only for interprocess invocations. Library components use the security level of the host process.