Skip to main content
Hi,

 

 

I am getting an "An unhandled exception of type 'Safe.FMEObjects.FMEOException' occurred in FMEObjectsDotNet4.dll" error on the following line of code: 
 m_fmeSession = FMEObjects.CreateSession(); m_fmeSession.Init(null); 
 

 

I get the same error thrown whether or not I follow the FME Objects tutorial or if I try to compile the Viewer example provided in <FME>\fmeobjects\samples\CSharp directory.  Same with using VS 2010 (.NET 4.0) and VS2012 (.Net 4.5)

 

 

This is the tail-end of the Output from the tutorial: 
 The thread 'vshost.LoadReference' (0x2058) has exited with code 0 (0x0). 'SampleFMEViewer.vshost.exe' (Managed (v4.0.30319)): Loaded 'c:\users\mszwaya.rose\documents\visual studio 2012\Projects\SampleFMEViewer\SampleFMEViewer\bin\Debug\SampleFMEViewer.exe', Symbols loaded. 'SampleFMEViewer.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Configuration\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. A first chance exception of type 'Safe.FMEObjects.FMEOException' occurred in FMEObjectsDotNet4.dll The program 'a4804] SampleFMEViewer.vshost.exe: Managed (v4.0.30319)' has exited with code -1 (0xffffffff). 
 

 

Thanks.
Hi,

 

 

Check the error message using try - catch clause. For example:

 

----

 

    try

 

    {

 

        m_fmeSession = FMEObjects.CreateSession();

 

        m_fmeSession.Init(null);

 

    }

 

    catch (FMEOException ex)

 

    {

 

        MessageBox.Show(ex.FmeErrorMessage);

 

    }

 

----

 

 

Initialization of FME session could fail, if multiple FME versions have been installed in the machine and you have used a newer FMEObjectsDotNet4.dll as the reference when building the program.

 

That is a reason for the error I can think of.

 

I noticed the error case last year, but it seems not to have been resolved in FME 2015.1.

 

It's also my own issue, so I'll request Safe support again.

 

 

Takashi

Reply