By `Lex Li`_
This page shows you information about the MIB-to-C# compilation feature, which is currently experimental.
#SNMP Library has a sample project that can work as a test agent. The agent can be manually extended to support more mangement objects, but it is possible to compile MIB documents to C# classes so as to simplify the process.
Generating C# Source files
To test it out with #SNMP MIB Compiler Pro, make sure that the menu item
"Generate C# source files from MIB documents" is checked on the tool bar. Then
C# source files will be generated when MIB documents are compiled, and saved to
a child folder called
modules in the folder that contains
To test out the same with SharpSnmpPro.Mib assembly,
- Clone the extensions assembly from GitHub .
- Replace the project reference to
SharpSnmpPro.Mibwith a NuGet package reference to
ObjectTree.GenerateSourceFiles(string outputFolder)method to generate C# source files.
Extending Test Agent
Once the source files are generated (in
modules foldler for example), a
C# project called
Objects.csproj can be found in the same folder.
snmpd.csproj in #SNMP Library source code, and add a reference to this
new project, and the generated management objects can be added to the agent for
There is no official support to use either the test agent or the generated C# classes for production usage.
MIB-to-C# compilation only generates new classes (or overwrites existing classes). Currently no plan to support in-place upgrade.