VB Migration Partner

KNOWLEDGE BASE - General


Previous | Index | Next 

[HOWTO] Modify project-level options in .NET programs

VB Migration Partner generates .NET projects with a set of “reasonable” options. For example, the output path of generated projects defaults to “bin\Debug\” and “bin\Release”, respectively in Debug and Release mode, and generate the XML documentation file. There is no specific pragma to directly modify these settings, however you can easily use one or more PostProcess pragmas to manipulate the .vbproj file.

For example, say that you want to disable the generation of XML documentation file for a specific project. All you need to do is adding the following pragma somewhere in your source code:

        '##  project:PostProcess "<DocumentationFile>.+</DocumentationFile>",
        <DocumentationFile></DocumentationFile>", True, True

Notice that the last argument is True, to ensure that the pragma is applied to source files other than *.vb or *.cs files. (In this specific case the pragma affects the .vbproj or .csproj file.)

By default, the .NET project generates the *.pdb file in Release mode. You can prevent this from happening by means of the following pragma:

        '##  project:PostProcess "<DebugType>pdbonly</DebugType>",
        "<DebugType>None</DebugType  >", True, True

Changing the output path for compiled programs is also simple, if you are familiar with regular expressions. Let’s say that you want to generate all executables in Debug mode in the folder c:\myexes\debug and all executable in Release mode in the folder c:\myexes\release. Here’s the pragma that does the trick:

        '## project:PostProcess "<OutputPath>bin\\(?<mod>Debug|Release)\\</OutputPath>",
        "<OutputPath>c:\\myexes\\${mod}\\</OutputPath>",  True, True

Notice that you have to double the backslash characters both in the first and in the second argument.

If you want to easily use these pragmas in multiple projects, store them in a VBMigrationPartner.pragmas file and copy the file to the folders where these projects resides.

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