Multi-project analysis - How to start

Enterprise Edition only

Multi-project analysis analyzes several projects together. It supports .vbg and .sln files.

Selecting the projects

There are several ways to select the input for multi-project analysis.

  1. Open a project group (.vbg) file (VB 5.0 and 6.0)
  2. Open a solution (.sln) file (VB.NET). Note that only the Visual Basic projects (.vbproj, .vbdproj) are analyzed but not any other projects such as C# or C++.
  3. Open any Visual Basic project.
  4. Open a .lst file you wrote. More
  5. Analyze a directory.

A dialog box appears where you can fine-tune the analysis that is about to start.

Select files to analyze dialog box

(See Start an analysis for more information about this dialog.)

COM files and .NET assemblies. This list includes the binary COM files and .NET assemblies that are referenced by the analyzed project(s). You will often see a list of DLLs, OCXs or TLB files here. Check all the binaries you want to include in your analysis. Most of the time, you probably only want to check the COM files that you wrote or that are of special interest to you. Tip: If you have the source code for a COM file available, press the Add project(s) button to analyze the source instead of the library file.

Add project(s) This button lets you add a single project, and also projects listed in a .vbg or .sln file, to the analysis. You can add any project to the analysis, but adding those projects that are related makes the most sense.

Dependencies

Dependencies Normally Project Analyzer is able to detect dependencies between projects. A project depends on another if it can use the classes, enums and other data types from another project. The usual way to add a project-to-project dependency in Visual Basic is to add a library or a project in the References dialog. For control projects, you can add a reference in the Components dialog.

If it should happen that you see cross-project calls missing or extra dead code reported, Project Analyzer might not have detected a dependency. Verify this via the View|Dependencies menu command in the main screen, or the Dependencies button in this dialog box. If any dependency is missing, you can manually add it. In the Refers to list, select the project for which you want to add a reference. A dialog pops up listing any new projects that the selected project may refer to. Note that not all projects will come up in this list, in particular those standard executable projects that don't expose an interface for other projects to call.

If you use late binding and the CreateObjects() function, your projects may not have a reference to each other, although there is a dependency at run-time. In this case, you will have to manually add a dependency each time you start the analysis.

You don't need to worry about dependencies if your projects aren't supposed to call each other. This happens if you want to analyze projects that share some source code files. In this case, you might want to make sure that the projects do not refer to each other by pressing the Dependencies button.

Note that a dependency doesn't necessarily mean that a project actually calls another. It's a possible reference, not an actual reference. If a dependency isn't found or defined, no calls will be detected because it's assumed that the projects cannot call each other.

Analysis with list files (.lst)

To repeatedly analyze the same group of files, create a .lst file that lists the files to load. The .lst file is a plain text file. You can create one with Notepad, for example.

In the .lst file, write a list of project filenames, project group filenames or solution filenames, one on each line. You can also add one or more directory pathnames.

Sample .lst file

system1.vbg
system2.vbg
projects\otherproject.vbp
c:\backup\backupproject.vbp
c:\modules\

If you omit the directory name, the file to load is in the same directory as the .lst file. Relative paths are relative to the location of .lst file. You can also use absolute paths. You can mix any project, project group or solution file types in the .lst file, or any directory paths.

Suggested uses for .lst files:

More about COM

Equality of a COM file and a .vbp project. When adding projects to the analysis, you may notice that some COM files disappear from the COM files list. This is normal and it happens when Project Analyzer detects a dependency between projects. When the source code project is available, Project Analyzer prefers it to the COM file, because the source contains more information. That's why it removes the COM file from the list.

Read COM analysis to find out how to analyze COM files.

© Project Analyzer Help