Hi
I just downloaded the latest NCryptoki v.1.5.4.2 full package. Running the included example FullTestNDigitSign returns an error when trying to sign a text (or a PDF):
###################################
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.
************** Exception Text **************
System.BadImageFormatException: Could not load file or assembly 'file:///C:\Users\stepcom\Documents\Visual Studio 2010\Projects\NDigitSign1.3.1.3\NDigitSign\bin\NCryptokiMngd.dll' or one of its dependencies. An attempt was made to load a program with an incorrect format.
File name: 'file:///C:\Users\stepcom\Documents\Visual Studio 2010\Projects\NDigitSign1.3.1.3\NDigitSign\bin\NCryptokiMngd.dll'
at System.Reflection.Assembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection)
at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
at System.Reflection.Assembly.LoadFrom(String assemblyFile)
at Cryptware.NCryptoki.Cryptoki.Attach(String cryptokilib)
at Cryptware.NCryptoki.Cryptoki..ctor(String cryptokilib)
at Cryptware.NDigitSign.DigitalSigner.Init(String cryptokiPath)
at FullTestNDigitSign.Form1.signTextButton_Click(Object sender, EventArgs e)
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].
************** Loaded Assemblies **************
mscorlib
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.4234 (VistaSP2GDR.050727-4200)
CodeBase: file:///C:/Windows/Microsoft.NET/Framework64/v2.0.50727/mscorlib.dll
----------------------------------------
FullTestNDigitSign
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0
CodeBase: file:///C:/Users/stepcom/Documents/Visual%20Studio%202010/Projects/NDigitSign1.3.1.3/NDigitSign/bin/FullTestNDigitSign.exe
----------------------------------------
System.Windows.Forms
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.4236 (VistaSP2GDR.050727-4200)
CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.4235 (VistaSP2GDR.050727-4200)
CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Drawing
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.4235 (VistaSP2GDR.050727-4200)
CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
NDigitSign
Assembly Version: 1.3.1.1
Win32 Version: 1.3.1.1
CodeBase: file:///C:/Users/stepcom/Documents/Visual%20Studio%202010/Projects/NDigitSign1.3.1.3/NDigitSign/bin/NDigitSign.DLL
----------------------------------------
NCryptoki
Assembly Version: 1.5.4.1
Win32 Version: 1.5.4.1
CodeBase: file:///C:/Users/stepcom/Documents/Visual%20Studio%202010/Projects/NDigitSign1.3.1.3/NDigitSign/bin/NCryptoki.DLL
----------------------------------------
************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.
For example:
<configuration>
<system.windows.forms jitDebugging="true" />
</configuration>
When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.
###################################
When running in VS debugger I get an error at line
DigitalSigner dsign = new DigitalSigner(p11dll);
----------
Could not load file or assembly 'NCryptoki, Version=1.5.3.2, Culture=neutral, PublicKeyToken=6a3e54934ab72177' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
----------
Do you have any hint what I can do to get the example running?
Thanks.