Install Microsoft Build Tools for Visual Studio
- Last UpdatedAug 07, 2024
- 2 minute read
Follow the procedure below to create an offline installer package for build tools and install it on a server that has no internet connectivity (that is, a server running the EFMBufferDacPacGenerator tool).
To install Microsoft Build Tools for Visual Studio
-
On a server with internet connectivity, navigate to the following site and download the Build Tools for Visual Studio installer:
https://visualstudio.microsoft.com/downloads/?q=build+tools
-
Create a folder to store the offline files.
The following steps, for example, use C:\BuildToolsInstaller.
-
Open a Windows PowerShell session and navigate to the location of the Build Tools installer (vs_BuildTools.exe).
-
Execute the following command:
.\vs_BuildTools.exe --layout C:\BuildToolsInstaller --lang en-US --add Microsoft.VisualStudio.Component.SQL.SSDTBuildSku --add Microsoft.Net.ComponentGroup.4.8.DeveloperTools
-
Wait for the download to complete.
-
Move the contents of the offline Build Tools files (for example, C:\BuildToolsInstaller) to the server on which you want to install Build Tools.
This is the server where you will run EFMBufferDacPacGenerator to create the Data-tier Application Package (DACPAC) file for the Electronic Flow Measurement (EFM) Buffer database.
-
Start an elevated PowerShell session.
-
Navigate to the location of the Build Tools installation files that you copied over in step 6 (for example, C:\BuildToolsInstaller).
It is possible for files to be blocked if they are copied from a jumpbox to a SCADA machine and the mspatch levels at the jumpbox are outdated. To unblock the files, proceed as follows:
-
Open a Windows PowerShell session.
-
Set the location to the location of the files.
-
Execute the following command:
dir -Recurse | Unblock-File
-
-
Execute the following command to install Build Tools without any user interaction (suitable for both Windows Server Core and Desktop Experience installations):
$process = Start-Process -FilePath vs_BuildTools.exe -ArgumentList "--noWeb", "--add", "Microsoft.VisualStudio.Component.SQL.SSDTBuildSku", "--add", "Microsoft.Net.ComponentGroup.4.8.DeveloperTools", "--quiet", "--wait" -Wait -PassThru
-
Execute the following command (it should return zero to indicate a successful installation):
Write-Output $process.ExitCode
Note: The default location of the MSBuild executable is C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Current\Bin. If this has been customized (by deviating from the steps above), you must update the MSBuildLocation configuration setting in the %DNADataRoot%\CloudData\Config\Settings\CloudData.json override file to match your actual installation directory.