Previous | Index | Next 

[HOWTO] Create a report with all the migration issues and warnings

A few users have asked for the ability to generate a report containing all the issues and warnings at the end of the migration process. Rather than including this feature in the core product, we decided to create an extender that perform this task. In current beta version this extender is named Report Creator and included in the CodeArchitects.VBMigrationPartner.Extenders DLL. You can enable this feature by adding this project-level pragma:

        '## project:SetTag MigrationReport, outputFile, appendMode, discardPrevious, detailLevel

If outputFile is omitted the report file is created in the output project’s folderl, is named after the VB.NET project file, and has an *.issues extension (e.g. MyProject.vbproj.issues). You can use a file name that is relative to the project’s folder.

The outputFile argument can also include one or more of the following placeholders:
     ${ProjectName} is replaced by the .NET project’s name
     ${ProjectFile} is replaced by the .NET project output file’s complete name
     ${ProjectPath} is replaced by the .NET project folder’s name

For example, you can create a report file named after the project and located in the c:\reports folder using this pragma:

        '## project:SetTag MigrationReport, c:\reports\${ProjectName}.xml

The advantage of using this syntax is that you can include this pragma in the centralized *.pragmas file and still generate a distinct report for each project.

Just as interesting, you can maintain a single report file for multiple migration tasks, which is especially useful when you use the VBMP utility to perform batch migration. In this case you should use True as the third argument, to ensure that results from a migration step are appended to the existing file:

        '## project:SetTag MigrationReport, c:\reports\mainreport.xml, True

When append mode is used, the results for the previous migration for the same project (if they exist) are preserved. If you want previous results to be replaced by the results from the current migration, just use the additional discardPrevious argument, as in

        '## project:SetTag MigrationReport, c:\reports\mainreport.xml, True, True

Notice that when discardPrevious è True, the report file is processed in memory and might file with very large report files (e.g. 60MB or larger), which might be the result of the migration of hundreds projects. In this case, we recommend that you manually delete the file at the beginning of each migration, and omit the discardPrevious argument.

Finally, the detailLevel optional argument can be 0 (the default, only the list of warnings and issues is included), 1 (project-level code metrics are also included) or 2 (code metrics for the entire project and for individual forms, modules, and classes are included).

        '## project:SetTag MigrationReport, c:\reports\mainreport.xml, True, True, 2


Previous | Index | Next