lextudio / sharpsnmplib

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

Compile Failure due to Dependents #401

Closed lextudio-support closed 2 hours ago

lextudio-support commented 2 hours ago

I'm working with your library trying to implement compiling into my application. Right now I'm using the code listed below, however when the Refresh method tries to Parse my Pending MibModule, it fails because some of the dependents are not found. The problem is that the Refresh method raised no error to tell me that it failed and why. How can I get the dependents and trap this error so I can try and compile those dependencies first?

customMibModule = Parser.Compile(_mibModule.FullFileName);
DefaultObjectRegistry.Instance.Import(customMibModule);
DefaultObjectRegistry.Instance.Refresh();

Original Reported Date: 2009-11-24T18:41:13.01-08:00 Original CodePlex Discussion Thread ID: 76145

lextudio-support commented 2 hours ago

Copied from CodePlex without authors:

It is appreciated if you can provide a sample project to reproduce the issue.

Then you can send the project to me at lextudiogmailcom

Regards,

Original Posted Date: 2009-11-24T23:57:46.98-08:00

lextudio-support commented 2 hours ago

Copied from CodePlex without authors:

I see that you are logging the error to something, so I will spend some more time looking to see if I can expose the dependencies

Original Posted Date: 2009-11-28T14:02:27.757-08:00

lextudio-support commented 2 hours ago

Copied from CodePlex without authors:

I finally figured out what you experienced.

When you tried to load a MIB document but its dependencies are missing, DefaultObjectRegistry will not report any error. That's by design, as you are responsible to provide all dependencies when compiling.

Our current compiler implementation can compile a document even if its dependencies are missing (as it does not check every aspects of a MIB document). But you can see how many modules are pending after compilation via DefaultObjectRegistry.Instance.Tree.PendingModules. In this way you can know there is something wrong.

Talking about which dependency is missing, the current compiler cannot do that.

Original Posted Date: 2009-11-29T22:36:59.167-08:00

lextudio-support commented 2 hours ago

Marked as Answer Date: 2013-10-06T21:41:53.283-07:00