-
Notifications
You must be signed in to change notification settings - Fork 130
01c Building Areg SDK with MSBuild
This guide covers building Areg SDK using Microsoft Visual Studio and MSBuild, including quick build steps and configuration options.
-
Microsoft Visual Studio 2019+ with:
- Desktop development with C++ workload
- CMake tools (optional, for CMake-based builds)
- Clang compiler for Windows (optional)
- Java 17+ - For code generation tools
- Git - Version control
Check MSBuild:
MSBuild -versionExpected output:
Microsoft (R) Build Engine version 17.x.x
...
Check Java:
java -versionExpected output:
openjdk version "17.x.x"
...
Note
MSBuild is installed with Visual Studio and should be in your PATH. If not, launch Developer Command Prompt for VS instead of regular Command Prompt.
git clone https://github.com/aregtech/areg-sdk.git
cd areg-sdkOption A: Visual Studio IDE
- Open
areg-sdk.slnin Visual Studio - Select build configuration (Debug/Release) from toolbar
-
Build → Build Solution (or press
Ctrl+Shift+B)
Option B: MSBuild Command Line
MSBuild ./areg-sdk.slnExpected output:
Microsoft (R) Build Engine version 17.x.x
...
Build succeeded.
0 Warning(s)
0 Error(s)
Time Elapsed 00:02:15.34
Build time: 2-5 minutes depending on configuration.
Binaries location:
.\product\build\msvc-{compiler}\windows-{bits}-{arch}-{config}-{linkage}\bin\
Example:
.\product\build\msvc-cl\windows-64-amd64-release-shared\bin\
MSBuild supports various configuration options to customize your build.
| Property | Values | Default | Description |
|---|---|---|---|
| Configuration |
Debug, Release
|
Debug |
Build type (optimizations, debugging) |
| Platform |
Win32, x64
|
Win32 |
Target architecture (32-bit or 64-bit) |
| AregExtended |
0, 1
|
1 |
Enable extended features in aregextend library |
| AregLogs |
0, 1
|
1 |
Enable logging infrastructure |
Tip
Edit msvc_setup.props in the Areg SDK root to set default values for all projects.
Example 1: 64-bit Debug build with extended features, no logging
MSBuild /m /property:Configuration=Debug /property:Platform=x64 /property:AregExtended=1 /property:AregLogs=0 ./areg-sdk.slnBreakdown:
-
/m- Build using multiple processors (parallel build) -
Configuration=Debug- Build with debug symbols -
Platform=x64- Target 64-bit architecture -
AregExtended=1- Include extended library -
AregLogs=0- Disable logging system
Example 2: 32-bit Release build with logging, no extended features
MSBuild /m /property:Configuration=Release /property:Platform=Win32 /property:AregExtended=0 /property:AregLogs=1 ./areg-sdk.slnBreakdown:
-
Configuration=Release- Optimized build -
Platform=Win32- Target 32-bit architecture -
AregExtended=0- Exclude extended library -
AregLogs=1- Enable logging system
Example 3: Clean and rebuild
MSBuild /m /t:Clean,Build /property:Configuration=Release /property:Platform=x64 ./areg-sdk.sln| Option | Description |
|---|---|
/m |
Multi-processor build (faster) |
/t:Build |
Build target (default) |
/t:Clean |
Remove build artifacts |
/t:Rebuild |
Clean + Build |
/v:minimal |
Reduce output verbosity |
/v:detailed |
Increase output verbosity |
/maxcpucount:4 |
Use specific number of processors |
Example with multiple options:
MSBuild /m /t:Rebuild /v:minimal /property:Configuration=Release /property:Platform=x64 ./areg-sdk.slnmsvc_setup.props
Contains default compilation settings and output paths. Located at:
areg-sdk/msvc_setup.props
Key settings you can modify:
- Output directories
- Compiler flags
- Warning levels
- Optimization settings
nuget.config
Specifies NuGet package sources for dependencies (Google Test Adapter for unit tests). Located at:
areg-sdk/nuget.config
Note
Areg SDK uses Google Test Adapter NuGet package for unit tests. Package directories are defined in nuget.config.
Problem: 'MSBuild' is not recognized as an internal or external command.
Solution:
Option 1: Use Developer Command Prompt
- Start Developer Command Prompt for VS from Start menu
- Navigate to
areg-sdkdirectory - Run MSBuild commands
Option 2: Add MSBuild to PATH
# Visual Studio 2022 example
set PATH=%PATH%;C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\BinOption 3: Use full path
"C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\MSBuild.exe" ./areg-sdk.slnProblem: Build fails with "Java is required for code generation".
Solution:
-
Verify Java installation:
java -version -
If not installed, download from java.com/download
-
Ensure Java is in PATH:
set PATH=%PATH%;C:\Program Files\Java\jdk-17\bin
Problem: Build fails after updating Areg SDK or Visual Studio.
Solution:
-
Clean the solution:
MSBuild /m /t:Clean ./areg-sdk.sln
-
Delete build artifacts:
rmdir /s /q .\product\build
-
Rebuild:
MSBuild /m /t:Build ./areg-sdk.sln
Problem: NuGet packages (Google Test) fail to restore.
Solution:
-
Restore packages manually:
nuget restore ./areg-sdk.sln
-
Or use MSBuild restore:
MSBuild /m /t:Restore ./areg-sdk.sln
-
Check nuget.config file points to valid package sources
Problem: Build produces 32-bit binaries when 64-bit was expected.
Solution:
Explicitly specify platform:
MSBuild /m /property:Platform=x64 ./areg-sdk.slnVerify in output:
Project "areg-sdk.sln" (Build target(s)):
...
Platform = x64
Problem: Build takes too long.
Solution:
-
Enable parallel build:
MSBuild /m /maxcpucount:8 ./areg-sdk.sln
-
Build only specific project:
MSBuild /m /t:"areg:Build" ./areg-sdk.sln
-
Use Release configuration (faster than Debug):
MSBuild /m /property:Configuration=Release ./areg-sdk.sln
Build only the core framework:
MSBuild /m /t:"areg:Build" /property:Configuration=Release /property:Platform=x64 ./areg-sdk.slnBuild only examples:
MSBuild /m /t:"examples:Build" /property:Configuration=Debug /property:Platform=x64 ./areg-sdk.slnFor CI/CD pipelines, use:
MSBuild /m /t:Rebuild /v:minimal /property:Configuration=Release /property:Platform=x64 /property:AregExtended=1 /property:AregLogs=0 ./areg-sdk.slnExplanation:
-
/t:Rebuild- Clean build (ensures fresh state) -
/v:minimal- Reduce log output (easier to parse) - Configuration settings suitable for release artifacts
Exit codes:
-
0- Success - Non-zero - Build failed
Integration Guides:
- Integrating Areg with Visual Studio - Using Areg SDK in your projects
- CMake Build Guide - Alternative build method
- vcpkg Installation - Package manager installation
Microsoft Documentation:
Areg SDK Resources:
- GitHub Repository
- MSBuild Workflow - CI/CD examples
- Discussions - Get help from community
Copyright © 2026, Aregtech
Help us to make docs greater: See something is wrong, unclear or need a help? Submit a change, open a discussion or ask AREG SDK community a question.
Copyright © 2026, Aregtech, www.areg.tech, email: info[at]areg.tech