Showing results for 
Search instead for 
Do you mean 
Solved! Go to solution

Release an *.exe from NX 11, VB.NET

[ Edited ]

I develop an .exe application with VB. NET run with NX (by Control + U), I add a button "Exit" so when I press this "Exit", my application can be released from NX. However,

if I use  


 --> My application is still being held by NX 


If I use


--> The NX will close 


Any suggestion to resolve the problem will be appreciated.


Accepted by topic author ulink2rle
‎02-20-2017 11:47 AM

Re: Release an *.exe from NX 11, VB.NET

Try adding this to your module or class:


    Public Function GetUnloadOption(ByVal dummy As String) As Integer
        Return Session.LibraryUnloadOption.Immediately
    End Function


Note that you do not need to call it; if it is there, NX should know what to do with it.  This is commonly used in NX Open .DLLs to make them unload as soon as the program is finished.  I don't really run .EXE files from inside NX, so I am not sure I have ever tested this in an .EXE, but it should be a simple test.


If that does not work, then you might try creating a .DLL instead of an .EXE.

Re: Release an *.exe from NX 11, VB.NET

[ Edited ]

Now I got it, I would need to build .dll instead of *.exe.  I actually I got this function included in my *.exe.


Thanks for the help.