Showing results for 
Search instead for 
Do you mean 

SEH Exception in GetSession()

Hello there,


i am getting following SEH Exception in GetSession() right at the beginning of my code:


A first chance exception of type 'System.Runtime.InteropServices.SEHException' occurred in NXOpen.Utilities.dll


The code worked a few days ago and I didn't change anything in here. NXOpen References are the same as well. Already tried signing the executable - but it didn't work.


Did anyone of you already have an exception like this?


I am glad for any help!


Code is following:


public NxRepair(NXToolPathDC MyUI)
            myNxUI = MyUI;                            
            changed = false;
                theSession = Session.GetSession();                    

                NxOperationlist = new List<NxOperation>();      
            catch (Exception ex)




Re: SEH Exception in GetSession()

[ Edited ]

I got detailed information about the exception:


System.Runtime.InteropServices.SEHException (0x80004005): External component has thrown an exception

   bei NXOpen.Utilities.BaseSession.JAM_SESSION_initialize()
   bei NXOpen.Utilities.BaseSession.StaticInitialize()
   bei NXOpen.Session.GetSession()

Nobody ever got this exception?

Re: SEH Exception in GetSession()

Does your code run from the Journal Editor?


When you say that signing "didn't work", do you mean that signing failed, or that the program was signed successfully, but still will not run?


Is this a .DLL or a .EXE?


When GetSession fails, it often means that there is a licensing problem, but I would expect a more meaningful error message.  Have you checked the syslog for helpful information?






Re: SEH Exception in GetSession()

Any solution for that. I got the same problem I have a signed EXE that runs successfully on my machine but fails on others machine. They got the same exception in GetSession()



Re: SEH Exception in GetSession()

Verify that you are running in a correctly configured environment - UGII_BASE_DIR, SPLM_LICENSE_SERVER, etc. are all defined correctly.


Start a NX Command Prompt (Start, All Programs, Siemens..., Tools, Command Prompt) and try to launch the executable from there.

Re: SEH Exception in GetSession()

 have just found the problem.


When setting my PATH variable before starting the EXE, I was writing




It should be




So the UGII_ROOT_DIR files will have priority on those already exisitng in the PATH variable.