0

I am new to C++/VC++ and SNMP. I am trying to implement Snmp extension agent which would send custom information for OIDs defined by me. I followed this link and got the Snmp extension agent working as expected. The application in the link is developed in native C++.

I would like to have the dll developed in VC++/C#. I compiled the application in C++/cli and deployed the dll, but Snmp service stopped picking up my dll. What am I missing?

Kannan D
  • 467
  • 1
  • 4
  • 15
  • You should provide more information, as based on your question, it's impossible to tell what's your problem. What's the snmp provider? Do you see any logs? Is your program working locally? And so on. – Dutow Jul 22 '16 at 12:06
  • How did you deploy the dll? What location is it deployed relative to the process? If you revert to the older version is it picked up again? – Richard Jul 22 '16 at 12:07
  • I followed [this link](http://www.codeproject.com/Articles/9025/How-to-install-SNMP-extension-agent-DLL) to deploy the dll. I am on Windows 7. After reverting to native c++ dll, snmp service started picking up the dll. – Kannan D Jul 22 '16 at 12:10
  • Apparently, the SNMP extension agents that you refer to can only be developed in managed code, see here: http://stackoverflow.com/questions/5057785/looking-for-an-net-snmp-extension-agent – Ton Plooij Jul 22 '16 at 14:33
  • @TonPlooij: I guess you meant "unmanaged code". I am trying to understand why can it not be done in managed code, as both native C++ and C++/cli have same target CPU and same dll exports. Why is the snmp service not picking up c++/cli dll? – Kannan D Jul 23 '16 at 11:17
  • Yes, that should be unmanaged code. C++/cli applications have a dependency on the .NET Framework. My guess is that SNMP extensions are dynamically loaded dlls and this mechanism does not support loading /clr dlls out of the box. See this link http://stackoverflow.com/questions/6207389/how-to-dynamically-load-a-c-sharp-dll-from-a-c-dll for more info on that. – Ton Plooij Jul 24 '16 at 10:46
  • @TonPlooij: Thanks for the link. "CLR Loading" is the concept I was looking for which I had never known. – Kannan D Aug 02 '16 at 06:16

0 Answers0