Repository navigation
Building from Source
knoxxr edited this page Jul 14, 2026
·
1 revision
- .NET 8 SDK
-
NetworkScanner(WPF) andSetupNetworkScanner(.vdproj) build/run on Windows only. -
NetworkScanner.Avalonia,NetworkScanner.Core, andNetworkScanner.Testsbuild and run on Windows / macOS / Linux.
# Full solution build — only works on Windows (includes the WPF project)
dotnet build NetworkScanner.sln
# On macOS/Linux the WPF project can't run, but you can still compile-check
# the whole solution:
dotnet build NetworkScanner.sln -p:EnableWindowsTargeting=true# Cross-platform Avalonia app (Windows / macOS / Linux)
dotnet run --project NetworkScanner.Avalonia
# Headless CLI
dotnet run --project NetworkScanner.Cli -- --range 192.168.1.0/24 --ports 22,80,443# xUnit — Core-only, runs on any OS
dotnet test NetworkScanner.Tests/NetworkScanner.Tests.csproj
# A single test
dotnet test NetworkScanner.Tests/NetworkScanner.Tests.csproj \
--filter "FullyQualifiedName~ScanEngineTests.ComputeIPCount_RangeCrossingSubnetBoundary_CountsCorrectly"NetworkScanner.Tests references only NetworkScanner.Core, so it runs on non-Windows environments too. Keep test-worthy logic in Core. Tests set UserDataPaths.OverrideRoot instead of touching the real profile.
dotnet publish NetworkScanner.Avalonia/NetworkScanner.Avalonia.csproj -c Release -r win-x64 --self-contained true
dotnet publish NetworkScanner.Avalonia/NetworkScanner.Avalonia.csproj -c Release -r osx-arm64 --self-contained true
dotnet publish NetworkScanner.Avalonia/NetworkScanner.Avalonia.csproj -c Release -r linux-x64 --self-contained trueThe vpk CLI wraps the publish output into per-OS installers. vpk can only build a package for the OS it runs on (no cross-packaging), so each package must be built on its own OS.
dotnet tool install -g vpk # once
export PATH="$PATH:$HOME/.dotnet/tools"
dotnet publish NetworkScanner.Avalonia/NetworkScanner.Avalonia.csproj -c Release -r osx-arm64 \
--self-contained true -o publish/osx-arm64
vpk pack --packId NetworkScanner --packVersion 1.0.0 \
--packDir publish/osx-arm64 --mainExe NetworkScanner.Avalonia \
--packTitle "Network Scanner" --packAuthors SMIC \
--runtime osx-arm64 --outputDir release-packages/osx-arm64On Windows, add --mainExe NetworkScanner.Avalonia.exe and --icon NetworkScanner/img/Kyo-Tux-Delikate-Network.ico to produce an installer with the app icon.
Two GitHub Actions workflows:
-
.github/workflows/build-and-test.yml— on every push/PR, verifies tests + build + packaging and stores artifacts (expire after 90 days). -
.github/workflows/release.yml— on av*.*.*tag push, runs publish +vpk packon the Windows/macOS/Linux runners and attaches the installers to a GitHub Release.dotnet publish -p:Version=<tag>stamps the real version; both UIs showver. Major.Minor.Buildin the sidebar.
Installers are unsigned — expect Gatekeeper/SmartScreen/AV false-positive warnings (see Troubleshooting & FAQ).
For an overview of how the projects fit together, see Architecture.