Signing an NXOpen .NET file
Signing an NXOpen .NET file
(OP)
Hello Everyone -
I am attempting to sign my first program with the NXOpen .NET author, but I keep getting an error when I attempt to run the SignLibrary command in command prompt. The error reads:
System.BadImageFormatException: An attempt was made to load a program with an incorrect format. (Exception from HRESULT:0x8007000B) at SignLibrary.JAM_SESSION_reserve_dotnet_author_license() as SignLibrary.Main(String[] args)
I can run my application in NX6.0.4.3 because the Log File reads:
System.Exception: Invalid NX signature found
at NXOpen.Utilities.BaseSession.verifyAssemblyData()
at NXOpen.Utilities.BaseSession.InitLicense()
Validation failed but author license exists - loading library.
I am using Visual Studio 2010 Express to embedd the resource file as "embedded resource", compile my source code and then attempt to run the SignLibrary command. Should I have an updated resource file when the Author license was added to my system? (When I open NXSigningResource.res in Notepad, the file just has two lines of text saying NXAUTHBLOCK, but no other information, is this correct?)
I do not know what I am doing wrong. I have attempted to follow the documentation that came with NX.
Any help would be greatly appreciated.
Thanks in advance,
I am attempting to sign my first program with the NXOpen .NET author, but I keep getting an error when I attempt to run the SignLibrary command in command prompt. The error reads:
System.BadImageFormatException: An attempt was made to load a program with an incorrect format. (Exception from HRESULT:0x8007000B) at SignLibrary.JAM_SESSION_reserve_dotnet_author_license() as SignLibrary.Main(String[] args)
I can run my application in NX6.0.4.3 because the Log File reads:
System.Exception: Invalid NX signature found
at NXOpen.Utilities.BaseSession.verifyAssemblyData()
at NXOpen.Utilities.BaseSession.InitLicense()
Validation failed but author license exists - loading library.
I am using Visual Studio 2010 Express to embedd the resource file as "embedded resource", compile my source code and then attempt to run the SignLibrary command. Should I have an updated resource file when the Author license was added to my system? (When I open NXSigningResource.res in Notepad, the file just has two lines of text saying NXAUTHBLOCK, but no other information, is this correct?)
I do not know what I am doing wrong. I have attempted to follow the documentation that came with NX.
Any help would be greatly appreciated.
Thanks in advance,
sumBuddy (Mechanical)
--------------------------------------------------------------------------------
"I would like to change the world, but I can't find the source code."





RE: Signing an NXOpen .NET file
Hope this helps.
Frank Swinkels
RE: Signing an NXOpen .NET file
Thanks for replying. I tried what you have suggested, and if I switch the "NXSigningResource.res" to build action "compile", then Visual Studio throws out an error when it attempts to compile by saying that "Declaration expected." (Visual Studio is looking at the resource file as a code file with this option.) So after that, I tried every other option available (I even tried: none)- Same error displayed everytime at the SignLibrary command prompt.
I called GTAC, and they said that the only Visual Studio version that is compatible with NX6 is VS2005 SP1, but also believes that the Express version will work. Well, I tried VS2005 Express, VS2008 Express, and none of these versions gave any success. I am waiting on my IT to install the Professional version of VS2005, but do not really believe that this is the problem.
Frank, do you have any other suggestions? Do you use the NX wizards that were designed for Visual Studio, or do you create a new project from scratch? I do not have to include any other references in my project especially for signing a program, do I?
Any other suggestions or help would be great.
Thanks,
sumBuddy (Mechanical)
--------------------------------------------------------------------------------
"I would like to change the world, but I can't find the source code."
RE: Signing an NXOpen .NET file
Finally after building your .dll or .exe you need to execute SignLibrary which is in the ugii directory (from a command window that has access to the ugii directory).
Hope this helps.
Frank Swinkels
RE: Signing an NXOpen .NET file
Thanks again for your help, but I resolved the issue with the assistance of GTAC personnel (thanks Amy!).
I never like to leave a thread unsolved for future reference, so let me document the problem and solution. I am running a 32-bit version of NX6.0.4.3 on a 64-bit machine. The SignLibrary executable will not return an error in this situation.
NX6.0.5 has a fix for this, and GTAC helped me swap out the problem file (run_managed.exe in the UGII directory) and the SignLibrary executable worked perfectly.
sumBuddy (Mechanical)
--------------------------------------------------------------------------------
"I would like to change the world, but I can't find the source code."