DotNetBuild

Top  Previous  Next

 

This command is only available to users that hold a Pro License

 

The DotNetBuild command allows you to build a Visual Studio solution using NetBuild.

 

Command Syntax

 

DotNetBuild:[Solution],[Configuration],[TargetFramework],[Directive(s)]

 

The colon after the command and the commas between parameters are compulsory. Any additional spaces or characters will cause an error to be thrown. The command itself is not case sensitive, but parameters may be depending on the operating system and locale.

 

Parameters:

 

Solution: The fully qualified path and file name(s) identifying the solution or project to build. The parameter must be surrounded by quotation marks if one or more spaces are included in the path and file name. It is good practice to include the quotation marks in any case, so that it reduces the risk of error when writing scripts.

Configuration: A string representing the build configuration to be used. This can be any configuration in the solution, for example 'Debug' or 'Release'. For more information see the Build Configurations section below.

TargetFramework: The framework under which the finished application should run. For example, to target the framework 4.7.2 you would enter 'net472' at this point. If you do not wish to specify a frameworklleave the parameter empty.

Directive(s): Zero or more preprocessor directives. Multiple directives are supported but must be separated Pipe characters and surrounded by quotation marks.  If no preprocessor directives are required leave the parameter empty.

 

All comma separators are compulsory as are the Solution and Configuration parameters. If either of those parameters is missing or invalid or the incorrect number of comma separators are provided an error will be thrown.

 

Build Configurations

 

Build configurations can be created by users, so it is not possible to give a definitive list from which to choose.  However, the following rules are followed by Visual Studio:

 

If a project configuration doesn't specify a platform or specifies just one platform, then a solution configuration whose name matches that of the new project configuration is either found or added. The default name of this solution configuration does not include a platform name; it takes the form <project configuration name>.

If a project supports multiple platforms, a solution configuration is either found or added for each supported platform. The name of each solution configuration includes both the project configuration name and the platform name, and has the form <project configuration name> <platform name>.

 

Examples:

 

Solution and Configuration, Framework defaulted and no Directives:

 

DotNetBuild:"C:\Source\My App.sln",Debug,,

 

All parameters specified:

 

DotNetBuild:"C:\Source\My App.sln",Release,net472,"directive1|directive2|directive3"

 

See Also: MsBuild MsTest