Prerequisites
- Development Environment
- Visual Studio Workloads
- System Requirements
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)
- 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:
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
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
Configuration Options Explained
Configuration Options Explained
- 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
5
Build the Solution
Build the complete solution:
- Press
Ctrl + Shift + B, or - Go to Build → Build Solution, or
- Right-click solution → Build Solution
The output will be a merged assembly containing all dependencies, making it a standalone executable.
Build Configurations
Release Build (Recommended)
Release Build (Recommended)
Best for production use and deploymentCharacteristics:
- Smaller file size
- Better performance
- No debugging symbols
- Suitable for deployment
Debug Build
Debug Build
Best for development and troubleshootingCharacteristics:
- Larger file size
- Includes debugging symbols
- Easier to troubleshoot
- Better for development
Custom Build Options
Custom Build Options
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
Red Underlines in Code
Red Underlines in Code
Issue: Visual Studio shows red underlines under code elementsSolution: This is usually a temporary IntelliSense issue:
- Try building the solution anyway (
Ctrl + Shift + B) - Clean and rebuild: Build → Clean Solution, then Build → Rebuild Solution
- Close and reopen Visual Studio
- Clear Visual Studio cache: Delete
binandobjfolders
Missing Dependencies
Missing Dependencies
Issue: Build fails with missing assembly referencesSolutions:
- Restore NuGet packages: Tools → NuGet Package Manager → Package Manager Console, then run
Update-Package -reinstall - Check .NET Framework version: Ensure you have .NET Framework 4.8 installed
- Verify Windows SDK: Install the latest Windows SDK if needed
- Clear NuGet cache:
nuget locals all -clear
Build Errors
Build Errors
Issue: Compilation errors during buildCommon Solutions:
- Update Visual Studio: Ensure you’re using a recent version
- Check target framework: Verify .NET Framework 4.8 is selected
- Clean solution: Build → Clean Solution, then rebuild
- Check file permissions: Ensure write access to the project directory
- Antivirus interference: Temporarily disable real-time protection during build
Post-Build Issues
Post-Build Issues
Issue: Build succeeds but executable doesn’t work properlyTroubleshooting Steps:
- Check dependencies: Ensure all required DLLs are present
- Run as administrator: Some features require elevated privileges
- Test in clean environment: Try running on a different machine
- Check .NET version: Target system must have .NET Framework 4.8
- Verify architecture: Ensure x64 build on x64 systems
Build Optimization
- Performance Optimizations
- Output Customization
- Security Considerations
Speed up build times:
-
Enable parallel builds:
- Tools → Options → Projects and Solutions → Build and Run
- Set “maximum number of parallel project builds” to your CPU core count
- Use SSD storage for faster I/O operations
-
Increase memory allocation:
-
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:
2
Basic Functionality Test
Test basic functionality to ensure the build works:
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
Command Line Build (MSBuild)
Command Line Build (MSBuild)
Build from command line using MSBuild:Advantages:
- Scriptable builds
- CI/CD integration
- Consistent build environment
Docker Build Environment
Docker Build Environment
Use Docker for consistent build environments: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.