From: Bob T. <Bob...@co...> - 2009-02-20 17:09:44
|
I'm having some troubles with getting OBDotNet to work and am hoping for some help. I have OpenBable-2.2.0 installed and am using VS 2008 sp1. I made the simplest program using System; using OpenBabel; namespace OpenBabelTesting { class Program { static void Main(string[] args) { OBConversion obc = new OBConversion(); } } } and when I run it I get this exception: System.TypeInitializationException was unhandled Message="The type initializer for 'OpenBabel.openbabelPINVOKE' threw an exception." Source="OBDotNet" TypeName="OpenBabel.openbabelPINVOKE" StackTrace: at OpenBabel.openbabelPINVOKE.new_OBConversion__SWIG_2() at OpenBabel.OBConversion..ctor() at OpenBabelTesting.Program.Main(String[] args) in C:\Projects\Constellation.HTS\ChemRegistration\OpenBabelTesting\Program.cs:line 10 at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args) at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args) at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly() at System.Threading.ThreadHelper.ThreadStart_Context(Object state) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.ThreadHelper.ThreadStart() InnerException: System.TypeInitializationException Message="The type initializer for 'SWIGExceptionHelper' threw an exception." Source="OBDotNet" TypeName="SWIGExceptionHelper" StackTrace: at OpenBabel.openbabelPINVOKE.SWIGExceptionHelper..ctor() at OpenBabel.openbabelPINVOKE..cctor() InnerException: System.DllNotFoundException Message="Unable to load DLL 'openbabel': The specified module could not be found. (Exception from HRESULT: 0x8007007E)" Source="OBDotNet" TypeName="" StackTrace: at OpenBabel.openbabelPINVOKE.SWIGExceptionHelper.SWIGRegisterExceptionCallbacks_openbabel(ExceptionDelegate applicationDelegate, ExceptionDelegate arithmeticDelegate, ExceptionDelegate divideByZeroDelegate, ExceptionDelegate indexOutOfRangeDelegate, ExceptionDelegate invalidCastDelegate, ExceptionDelegate invalidOperationDelegate, ExceptionDelegate ioDelegate, ExceptionDelegate nullReferenceDelegate, ExceptionDelegate outOfMemoryDelegate, ExceptionDelegate overflowDelegate, ExceptionDelegate systemExceptionDelegate) at OpenBabel.openbabelPINVOKE.SWIGExceptionHelper..cctor() InnerException: I thought it had something to do with openbabel.dll but I could not add it as a reference to my project or the GAC. Any ideas? Thanks in advance, Bob |