Skip to content

Installation Guide

SmrtHub runs best when the .NET and Python toolchains are configured exactly as the platform expects. Follow the steps below to get a reproducible developer workstation.

1. Prerequisites

Requirement Notes
Windows 10/11 x64 All packaging and supervision targets Windows; use a local administrator account for first run.
.NET SDK 8.0.x dotnet --list-sdks should list 8.0.
Python 3.12.x (64-bit) Install from python.org or the Windows Store; ensure it is on PATH.
PowerShell 7.2+ Repo scripts assume modern PowerShell; pwsh --version confirms.
Git Optional but recommended for branch management and updates.

Install Visual Studio 2022 or VS Code with the C# Dev Kit if you plan to debug C# interactively.

2. Clone the Repository

cd C:\AppProjects
git clone https://github.com/snaprunlabs/smrthub.git SmrtHub.App
cd SmrtHub.App

The repo expects to live at C:\AppProjects\SmrtHub.App; adjust only if you also update the solution’s local configuration paths.

3. Bootstrap All Runtimes

Use the consolidated build script to compile .NET apps and prime the Python environment in one pass:

pwsh Tools/Clean-Build/BuildApps.ps1 -Scope AppsLibsPlusPython -Configuration Debug -RuntimeIdentifier win-x64

This performs the following:

  • Restores NuGet packages using the central version pins.
  • Builds every supervised .NET application and shared library in Debug.
  • Creates (or reuses) SmrtApps/PythonApp/.venv and installs documentation + runtime requirements.
  • Emits XML doc output required for MkDocs API generation.

If you only need the Python artifacts (for example, during docsite work), run:

pwsh SmrtApps/PythonApp/BuildPythonApp.ps1 -Configuration Debug -RuntimeIdentifier win-x64

4. Verify the Environment

.NET

dotnet test SmrtApps/SmrtHub.sln --filter Category!=Integration

Python

& SmrtApps/PythonApp/.venv/Scripts/Activate.ps1
python -m unittest -v python_core.tests.test_logger
deactivate

Both suites should pass before you continue. If restore issues appear, confirm you have run PowerShell as an administrator at least once to allow script execution.

5. IDE Configuration

Visual Studio 2022

  1. Open SmrtApps/SmrtHub.sln.
  2. Set SmrtHub.App as the startup project.
  3. Use the Debug | x64 configuration; the repo targets win-x64 explicitly.
  4. Ensure XML documentation warnings are treated as errors (already configured in the projects).

Visual Studio Code

The workspace file SmrtHub.code-workspace preconfigures:

  • Default PowerShell terminal at the repo root.
  • Python interpreter pointing at .venv (after the first build).
  • Tasks for building (⚙️ Build: All Apps and Libraries + PythonApp) and serving docs (📖 Build & Serve MKDocs).

6. Prepare Operational Directories

Run the supervisor once so canonical config folders exist:

dotnet run --project SmrtApps/CSApps/SmrtHubSupervisor/SmrtHubSupervisor.csproj -c Debug -r win-x64

Stop the process after it reports that components are staged. This primes %AppData%/SmrtHub/Config/** so you can follow the Workspace Configuration guide.

7. Troubleshooting Checklist

  • NU1008 errors – Indicates a PackageReference contains an inline Version. Remove it and rely on Directory.Packages.props.
  • Python import errors – Activate .venv and ensure SmrtApps/PythonApp is on the PYTHONPATH. The build script sets this automatically; avoid using system Python for development.
  • Locked files – If previous runs left background processes running, use the supervisor’s tray UI or Task Manager to stop them before rebuilding.
  • Event Log warnings – Local builds run in Debug; Windows Event Log sinks stay disabled unless the environment is set to Production.

8. What’s Next