KB 600005 How to compile source code on Windows

Summary

This article describes how to compile #SNMP source code on Windows.

Prerequisites

You may check out the source code using Git, from https://github.com/lextm/sharpsnmplib or download the ZIP package from the GitHub page.

Default Configuration

#SNMP has several projects. Most of them are configured to compile against .NET Framework 3.5 except SharpSnmpLib.csproj who is against .NET Framework 2.0.

If you have .NET Framework 3.5 installed

.NET Framework 3.5 SP1 is available here.
  1. Install .NET SDK or Visual Studio.
  2. Execute prepare.bat to prepare necessary files.
  3. Execute release.35.bat to build the source code.
The compiled binaries are in the bin folder. They are built using MSBuild 3.5. Core assemblies are against .NET 2.0 SP2, while others against .NET 3.5 SP1.

If you have .NET Framework 4.0 installed

.NET Framework 4.0 installer is available here.
  1. Install .NET SDK or Visual Studio.
  2. Execute prepare.bat to prepare necessary files.
  3. Execute release.bat to build the source code.
The compiled binaries are in the bin folder. They are built using MSBuild 4.0. Core assemblies are against .NET 2.0 SP2, while others against .NET 3.5 SP1.

More Information

#SNMP is supported on Windows XP (SP3), Windows Vista (SP2), Windows 7, Windows Server 2003 (SP2), Windows Server 2008 (SP2), and Windows Server 2008 R2.

WinForms applications are not recommended to be edited in Visual Studio 2008. Please switch to Visual Studio 2010 (including Visual C# 2010).

Compile #SNMP Against .NET Framework 4.0

You must have .NET Framework 4.0 installed.
  1. Open a Visual Studio 2010 command prompt and navigate to the folder that contains sharpsnmplib.sln.
  2. Execute "msbuild sharpsnmplib.sln /p:TargetFrameworkVersion=v4.0"

All resulting assemblies are linked against .NET 4 version of mscorlib.dll, and so on.

.NET 4

References

N/A

Last edited Jan 27, 2012 at 3:56 AM by lextm, version 5