Build the GitM add-in¶
This produces the three add-in DLLs that the installer bundles. It is the first step before creating the installer.
This is the operational summary. For project layout, the service-separation rule, and runtime constraints, see
DEVELOPER.mdin the GitM repository.
Prerequisites¶
| Requirement | Version | Notes |
|---|---|---|
| .NET SDK | Any recent | For the dotnet CLI |
| .NET Framework | 4.8 | Target framework — not .NET 6/8 |
| Visual Studio | 2022 | Optional; the CLI build is sufficient |
| SolidWorks | 2021+ | Only needed to test the add-in, not to compile it |
SolidWorks interop DLLs are committed to
lib/solidworks/, so you can build without SolidWorks installed.
Build the DLLs¶
Always build via the SolidWorks project — it copies every dependency to the correct output
folder. Build Release (the installer pulls from bin/Release):
dotnet build GitM.SolidWorks/GitM.SolidWorks.csproj -c Release --no-incremental
Output lands in GitM.SolidWorks/bin/Release/net48/:
GitM.SolidWorks.dll,GitM.Core.dll,GitM.UI.dll(the add-in)- third-party runtime DLLs (Newtonsoft.Json, CommunityToolkit.Mvvm, Serilog, …)
- the version-matched
SolidWorks.Interop.*assemblies
The installer's [Files] section references exactly these paths, so a clean Release build must
exist before you compile the installer.
Build as AnyCPU (default). Do not pass
-p:Platform=x64. The default configuration lands the DLLs inbin\Release\net48where the installer and SolidWorks expect them.
Set the deployment URLs (before building)¶
The add-in is a compiled .dll that runs on customer workstations — there is no runtime
environment to configure, so its URLs are baked in at compile time. They live in a single
file:
GitM.Core/Configuration/DeploymentConfig.cs
internal static class DeploymentConfig
{
internal const string GitMCloudBaseUrl = "https://gitmcloud.gojain.com"; // web app
internal const string DocsUrl = "https://gitmdocs.gojain.com"; // ?→Help
internal const string RealtimeDbUrl = "https://gitmcloud-default-rtdb.firebaseio.com";
}
Every other place in the add-in (UserSettings, GitMVersion, the Supplier Exchange context)
references these constants — so to point a build at a new domain you edit only this file,
then rebuild and recompile the installer. Verify the values here match your live deployment
before every release build.
The per-user
GitMCloudBaseUrlinUserSettingsis an optional override (e.g. to point a test build atlocalhost).DeploymentConfigsupplies the default when no override is set.
If the build fails with a file lock¶
SolidWorks (with the add-in loaded) holds the output DLLs open. Unload the add-in in SolidWorks → Tools → Add-ins, or close SolidWorks, then rebuild.
Run the tests (optional)¶
dotnet test GitM.Tests/GitM.Tests.csproj
Tests reference GitM.Core only — no SolidWorks or UI required.