Skip to main content
Legal Notice: Only build and use SharpSCCM in authorized environments. Ensure you have proper permission before compiling or executing this tool.

Prerequisites

Required Software:
  • Visual Studio 2019 or later (Community Edition is sufficient)
  • .NET Framework 4.8 or later
  • Git client (for cloning the repository)
  • Windows 10/11 or Windows Server 2016+ (recommended)
Optional but Recommended:
  • Visual Studio Code (for quick edits)
  • GitHub Desktop (for easier repository management)
  • Windows SDK (for advanced debugging)

Step-by-Step Build Process

1

Clone the Repository

Open a command prompt or PowerShell terminal and clone the repository:
git clone https://github.com/Mayyhem/SharpSCCM.git
cd SharpSCCM
Alternative: You can also download the source as a ZIP file from GitHub if you prefer not to use Git.
2

Open the Solution

Launch Visual Studio and open the solution file:
  • File → Open → Project/Solution
  • Navigate to the cloned repository directory
  • Select SharpSCCM.sln
Quick Tip: You can also double-click the .sln file in Windows Explorer to open it directly in Visual Studio.
3

Configure Build Settings

Select your target configuration and platform:Recommended Settings:
  • Configuration: Release (for production use)
  • Platform: x64 (for better compatibility)
  • Target Framework: .NET Framework 4.8
  • Debug: Includes debugging symbols, larger file size, slower execution
  • Release: Optimized build, smaller file size, faster execution
  • AnyCPU: Runs on both x86 and x64 (may have compatibility issues)
  • x64: Specifically targets 64-bit systems (recommended)
  • x86: Targets 32-bit systems (legacy compatibility)
4

Restore NuGet Packages

Before building, restore all required dependencies:
  • Right-click on the solution in Solution Explorer
  • Select “Restore NuGet Packages”
  • Wait for the restore process to complete
Update-Package -reinstall
5

Build the Solution

Build the complete solution:
  • Press Ctrl + Shift + B, or
  • Go to Build → Build Solution, or
  • Right-click solution → Build Solution
Expected Output Location:
.\SharpSCCM\bin\x64\Release\SharpSCCM.exe
The output will be a merged assembly containing all dependencies, making it a standalone executable.

Build Configurations

Best for development and troubleshooting
Configuration: Debug
Platform: x64
Optimizations: Disabled
Debug Info: Full
Characteristics:
  • Larger file size
  • Includes debugging symbols
  • Easier to troubleshoot
  • Better for development
Advanced configuration optionsYou can customize builds by editing the project properties:
  • Right-click project → Properties
  • Modify compilation constants
  • Adjust optimization settings
  • Configure post-build events

Troubleshooting Common Issues

Issue: Visual Studio shows red underlines under code elementsSolution: This is usually a temporary IntelliSense issue:
  1. Try building the solution anyway (Ctrl + Shift + B)
  2. Clean and rebuild: Build → Clean Solution, then Build → Rebuild Solution
  3. Close and reopen Visual Studio
  4. Clear Visual Studio cache: Delete bin and obj folders
Issue: Build fails with missing assembly referencesSolutions:
  1. Restore NuGet packages: Tools → NuGet Package Manager → Package Manager Console, then run Update-Package -reinstall
  2. Check .NET Framework version: Ensure you have .NET Framework 4.8 installed
  3. Verify Windows SDK: Install the latest Windows SDK if needed
  4. Clear NuGet cache: nuget locals all -clear
Issue: Compilation errors during buildCommon Solutions:
  1. Update Visual Studio: Ensure you’re using a recent version
  2. Check target framework: Verify .NET Framework 4.8 is selected
  3. Clean solution: Build → Clean Solution, then rebuild
  4. Check file permissions: Ensure write access to the project directory
  5. Antivirus interference: Temporarily disable real-time protection during build
Issue: Build succeeds but executable doesn’t work properlyTroubleshooting Steps:
  1. Check dependencies: Ensure all required DLLs are present
  2. Run as administrator: Some features require elevated privileges
  3. Test in clean environment: Try running on a different machine
  4. Check .NET version: Target system must have .NET Framework 4.8
  5. Verify architecture: Ensure x64 build on x64 systems

Build Optimization

Speed up build times:
  1. Enable parallel builds:
    • Tools → Options → Projects and Solutions → Build and Run
    • Set “maximum number of parallel project builds” to your CPU core count
  2. Use SSD storage for faster I/O operations
  3. Increase memory allocation:
    <PropertyGroup>
      <MSBuildArguments>/m /p:UseSharedCompilation=false</MSBuildArguments>
    </PropertyGroup>
    
  4. Exclude directories from antivirus scanning:
    • Add your development folder to antivirus exclusions
    • Exclude Visual Studio processes from real-time scanning

Verification & Testing

1

Verify Build Success

After a successful build, verify the output:
# Check if file exists and get file info
Get-ChildItem ".\SharpSCCM\bin\x64\Release\SharpSCCM.exe" | Select-Object Name, Length, LastWriteTime

# Verify .NET Framework version
[System.Reflection.Assembly]::LoadFile("$PWD\SharpSCCM\bin\x64\Release\SharpSCCM.exe").ImageRuntimeVersion
2

Basic Functionality Test

Test basic functionality to ensure the build works:
# Display help information
.\SharpSCCM.exe --help

# Test local site information (safe command)
.\SharpSCCM.exe local site-info
Only run these tests in authorized lab environments.
3

Environment Validation

Ensure the built executable works in your target environment:
  • Test on different Windows versions
  • Verify SCCM client compatibility
  • Check domain/workgroup scenarios
  • Validate privilege requirements

Alternative Build Methods

Build from command line using MSBuild:
# Navigate to project directory
cd SharpSCCM

# Build using MSBuild
msbuild SharpSCCM.sln /p:Configuration=Release /p:Platform=x64

# Or use dotnet CLI if available
dotnet build SharpSCCM.sln --configuration Release
Advantages:
  • Scriptable builds
  • CI/CD integration
  • Consistent build environment
Use Docker for consistent build environments:
FROM mcr.microsoft.com/dotnet/framework/sdk:4.8
WORKDIR /src
COPY . .
RUN msbuild SharpSCCM.sln /p:Configuration=Release /p:Platform=x64
Benefits:
  • Reproducible builds
  • Isolated environment
  • Cross-platform development support

Next Steps

Command Line Usage

Learn how to use SharpSCCM effectively

Get Started with Commands

Begin with information gathering commands

Security Considerations

Understand defensive measures and detection

GitHub Repository

Access source code and report issues
Need Help? If you encounter build issues not covered here, check the GitHub Issues or create a new issue with your build environment details.