How do I deploy the NetToolWorks .NET SNMP Framework without deploying your license?
To deploy the NetToolWorks .NET SNMP Framework components and classes you must first compile a valid license into your project. This can be accomplished in a Visual Studio.NET project through a licenses.licx file. Licenses.licx files are a way for Visual Studio .NET to discover what components in your project are licensed. Visual Studio.NET will then ask each licensed component for a license at compile time. It then compiles the license into the output binary (.exe or .dll). Later at runtime the component can retrieve the license from the binary for verification. This allows you to distribute the components without the deploying a license to the target machine. Wherever the binary goes the license will go with it.
How do I create and add a licenses.licx file to my project?
Follow these simple steps to manually add a licenses.licx file to your project:
- Right click the project that references the assemblies the licensed components are in. Select Add | Add New Item.
- Select Text File form the Templates pane and enter licenses.licx in the Name field. Click the Open button.
- Add the following text to the licenses.licx file:
NetToolWorks.Snmp.SnmpVersion1, NetToolWorks.Snmp
NetToolWorks.Snmp.SnmpVersion2C, NetToolWorks.Snmp
NetToolWorks.Snmp.SnmpVersion3, NetToolWorks.Snmp
NetToolWorks.Snmp.Management.SnmpVersion3Discovery, NetToolWorks.Snmp
NetToolWorks.Snmp.Management.TrapListener, NetToolWorks.Snmp
NetToolWorks.Snmp.Management.ManagerFactory, NetToolWorks.Snmp
NetToolWorks.Snmp.Agent.TrapSender, NetToolWorks.Snmp
NetToolWorks.Snmp.Agent.NotificationSender, NetToolWorks.Snmp
NetToolWorks.Snmp.Mib.MibParser, NetToolWorks.Snmp
- Save the licenses.licx file.
- Rebuild the project.
Please note you must be on a machine that has a valid license registered for the components you are using in your project for this to work.
What files must I distribute with my application and where do I put them?
The NetToolWorks .NET SNMP Framework consists of one .dll to distribute:
NetToolWorks.Snmp.dll
The NetToolWorks.Snmp.dll can be distributed in two ways. The first and preferred way to deploy the .dll is to include it in the same directory as the executable that references it. For example if you have project called Application1 that references the SnmpVersion1 class then you would deploy the Application1.exe and NetToolWorks.Snmp.dll in the same directory.
The second way is to put the .dll in the Global Assembly Cache (GAC). This can be done with the GAC GUI tool, gacutil command line executable, or a third party installer like InstallShield or Wise Installer. Please see the Microsoft .NET Framework SDK documentation for more details on using the above mentioned tools or the corresponding documentation for the third party tool you choose.