This guide covers the Visual Studio 2022 setup required for FieldWorks development.
$FWROOTin this document refers to the root directory of the FieldWorks source tree (where you cloned the repository).
-
Download Visual Studio 2022 Community Edition (or Professional/Enterprise):
- Go to https://visualstudio.microsoft.com/vs/
- Download and run the installer
-
Select the following Workloads:
- ✅ .NET desktop development
- ✅ Desktop development with C++
-
Select the following Individual Components:
- ✅ C++ ATL for latest v143 build tools (x86 & x64)
- ✅ C++ MFC for latest v143 build tools (x86 & x64)
- ✅ Windows 11 SDK (10.0.22621.0)
- ✅ .NET Framework 4.8.1 SDK
- ✅ .NET Framework 4.8.1 targeting pack
This is required to match our coding standards:
- Go to Tools → Options
- Navigate to Text Editor → All Languages → Tabs
- Select the "Keep tabs" radio option
- Verify Tab size and Indent size are both 4
If you have ReSharper installed:
The shared settings file is located at $FWROOT/FW.sln.DotSettings. If you save your solution as $FWROOT/FieldWorks.sln, the shared settings will automatically be picked up.
Alternatively:
- Copy the file and give it the same name as your solution with a
.sln.DotSettingsextension - Or import settings via ReSharper → Manage Options → Import/Export Settings → Import from file
Tip: Using the shared settings file directly has the advantage that ReSharper will pick up any changes made to the shared settings.
Open the main solution file:
$FWROOT\FieldWorks.sln
This solution contains all the FieldWorks projects organized for development.
Visual Studio may have difficulty building all projects in the correct order. For reliable builds, add the build script as an External Tool:
- Click Tools → External Tools...
- Click Add and configure:
Build FW (Full):
Title: Build FW Full
Command: powershell.exe
Arguments: -ExecutionPolicy Bypass -File .\build.ps1
Initial directory: $(SolutionDir)
Select ✅ "Use Output window"
Build FW (Release):
Title: Build FW Release
Command: powershell.exe
Arguments: -ExecutionPolicy Bypass -File .\build.ps1 -Configuration Release
Initial directory: $(SolutionDir)
Select ✅ "Use Output window"
Build from PowerShell before opening Visual Studio:
.\build.ps1Then use Visual Studio for editing and debugging.
- Set FieldWorks (or the specific project you're working on) as the Startup Project
- Ensure the configuration is Debug and platform is x64
- Press F5 to start debugging
- Open Test → Test Explorer
- Build the solution to discover tests
- Run individual tests or all tests from the Test Explorer
Add a test tool:
Title: Run Tests
Command: powershell.exe
Arguments: -ExecutionPolicy Bypass -File .\build.ps1 -MsBuildArgs @('/p:action=test')
Initial directory: $(SolutionDir)
Some legacy branches may require .NET Framework 2.0. To install:
- Launch "Turn Windows features on or off"
- Select ".NET Framework 3.5 (includes .NET 2.0 and 3.0)" and click OK
If native C++ components fail to build:
- Ensure you have the C++ workload installed
- Try building from the command line first:
.\build.ps1
This is expected - Visual Studio may not load all 100+ projects correctly. Use the command-line build for full builds, and Visual Studio for editing and debugging specific projects.
- CONTRIBUTING.md - Getting started guide
- Build Instructions - Detailed build system documentation
- Commit message guidelines - CI-enforced commit rules