lextudio / sharpsnmplib

Sharp SNMP Library- Open Source SNMP for .NET
https://sharpsnmp.com
MIT License
357 stars 152 forks source link

SharpSnmpLib doesn't work with .NET 4.0 #366

Open lextudio-support opened 2 hours ago

lextudio-support commented 2 hours ago

I want to use the C# SNMP Agent that is included with SharpSnmpLib. I need to include some of my own C# DLLs as references so I can access the data the agent needs to manage. I can't add the references because all of my DLLs are built against .NET 4.0. When I try to add the refence I get an error saying my DLL was built against a later version of .NET. If I try to change the target framework of the projects (in SnmpSharLib.sln) to .Net 4.0, the code will compile, but when I try to run the snmpd agent I get a BadImageFormatException that says "Could not load file or assembly 'snmpd.exe' or one of its dependancies. This assembly is built by a runtime newer than the currenly loaded runtime and cannot be loaded." Any suggestions on how to get the snmpd agent to work with other .NET 4.0 DLLs will be greatly appreciated.

Original Reported Date: 2012-12-18T08:37:51.38-08:00 Original CodePlex Discussion Thread ID: 407187

lextudio-support commented 2 hours ago

Copied from CodePlex without authors:

There is a fork on GitHub by neutmute, that converts all projects to .NET 4,

https://github.com/neutmute/sharpsnmplib/commits/

You should try if that meets your need instead of doing it on your own. If this is your very first time to migrate projects across major .NET releases (2->4), it is rather difficult to make it right at the first attempt.

Besides, KB600005 does mention how to compile #SNMP against .NET 4 via command line,

http://sharpsnmplib.codeplex.com/wikipage?title=600005&referringTitle;=KB

Original Posted Date: 2012-12-18T18:16:36.087-08:00