Select projects for build process
The Visual Studio API provides all mechanisms required to select projects for a Solution Configuration. The necessary methods are part of the SolutionBuild2 class of the EnvDTE namespace. The following example demonstrates how to use the method BuildProject() from that class.
Code Snippet (Powershell):
$sln = $dte.Solution
$prj = $dte.Projects.Item(1) #SysMan Project
$sysManProjectName = $prj.FullName
$plcPrjProjectName = PathToPlcProjFile
$sln.SolutionBuild.BuildProject("Release|TwinCAT RT (x64)",$sysManProjectName,$true)
$sln.SolutionBuild.BuildProject("Release|TwinCAT RT (x64)",$plcPrjProjectName,$true)
The placeholder “pathToPlcProjFile” represents the full path to a *.plcproj file which represents a TwinCAT 3 PLC project.