Reputation: 43
I have been working on implementing the Secugen fingerprint reader and API into a ASP.NET website for a homeless shelter and it is driving me insane. I am using the FDx SDK Pro for Windows API and I have custom COM components (via OCX file) that imports activeX controls into my toolbox. However the controls are only able to be used when I create a Windows Application and then create a windows form. I need to have these controls in a web form. If I try to put them in the webform the activeX tools are grayed out and it doesn't let me. There is an example with the .htm that does exactly what I am looking for so I know it is possible but I just can't tell what the dependencies are. I just am not familiar with .NET and assembly libraries. Here is the readme that comes with the API that contains the different files it has. I'm not sure if I have to create a Windows form first and then put it into my website as an object. I have tried to just put the "SecuGen.FdxSdkPro.Windows.dll" file into my bin folder but then when I run it I get the following error when I go to run it. Any input would be appreciated and let me know if uploading the .htm example or providing code would be any use.
Compile Error
Could not load file or assembly 'SecuGen.FDxSDKPro.Windows' or one of its dependencies. An attempt was made to load a program with an incorrect format.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.BadImageFormatException: Could not load file or assembly 'SecuGen.FDxSDKPro.Windows' or one of its dependencies. An attempt was made to load a program with an incorrect format.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Assembly Load Trace: The following information can be helpful to determine why the assembly 'SecuGen.FDxSDKPro.Windows' could not be loaded.
=== Pre-bind state information ===
LOG: DisplayName = SecuGen.FDxSDKPro.Windows
(Partial)
WRN: Partial binding information was supplied for an assembly:
WRN: Assembly Name: SecuGen.FDxSDKPro.Windows | Domain ID: 5
WRN: A partial bind occurs when only part of the assembly display name is provided.
WRN: This might result in the binder loading an incorrect assembly.
WRN: It is recommended to provide a fully specified textual identity for the assembly,
WRN: that consists of the simple name, version, culture, and public key token.
WRN: See whitepaper http://go.microsoft.com/fwlink/?LinkId=109270 for more information and common solutions to this issue.
LOG: Appbase = file:///f:/Documents/GitHub/Homeless_Intake/WebSite1/
LOG: Initial PrivatePath = f:\Documents\GitHub\Homeless_Intake\WebSite1\bin
Calling assembly : (Unknown).
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: f:\Documents\GitHub\Homeless_Intake\WebSite1\web.config
LOG: Using host configuration file:
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
LOG: Attempting download of new URL file:///C:/Users/Farr/AppData/Local/Temp/Temporary ASP.NET Files/website1/66e0b9e8/94cdddbc/SecuGen.FDxSDKPro.Windows.DLL.
LOG: Attempting download of new URL file:///C:/Users/Farr/AppData/Local/Temp/Temporary ASP.NET Files/website1/66e0b9e8/94cdddbc/SecuGen.FDxSDKPro.Windows/SecuGen.FDxSDKPro.Windows.DLL.
LOG: Attempting download of new URL file:///f:/Documents/GitHub/Homeless_Intake/WebSite1/bin/SecuGen.FDxSDKPro.Windows.DLL.
ERR: Failed to complete setup of assembly (hr = 0x8007000b). Probing terminated.
Stack Trace:
[BadImageFormatException: Could not load file or assembly 'SecuGen.FDxSDKPro.Windows' or one of its dependencies. An attempt was made to load a program with an incorrect format.]
System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +0
System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +34
System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +152
System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean forIntrospection) +77
System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +16
System.Reflection.Assembly.Load(String assemblyString) +28
System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +38
[ConfigurationErrorsException: Could not load file or assembly 'SecuGen.FDxSDKPro.Windows' or one of its dependencies. An attempt was made to load a program with an incorrect format.]
System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +752
System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory() +218
System.Web.Configuration.CompilationSection.LoadAssembly(AssemblyInfo ai) +130
System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection compConfig) +170
System.Web.Compilation.BuildManager.GetPreStartInitMethodsFromReferencedAssemblies() +91
System.Web.Compilation.BuildManager.CallPreStartInitMethods(String preStartInitListPath, Boolean& isRefAssemblyLoaded) +285
System.Web.Compilation.BuildManager.ExecutePreAppStart() +153
System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException) +516
[HttpException (0x80004005): Could not load file or assembly 'SecuGen.FDxSDKPro.Windows' or one of its dependencies. An attempt was made to load a program with an incorrect format.]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +9915300
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +101
System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) +456
FDx SDK Pro for Windows Copyright (C) 1998-2014 SecuGen Corporation
Version : 3.7 Date : November, 2013
Date : July, 2009
Version : 3.53 Date : January, 2009
SecuGen USB port devices (FDU02, FDU03, FDU04, FDU05 or U20): - IBM-compatible PC 486 or later - CD ROM Drive - 1 USB 2.0 port - 64MB RAM - 80MB available hard disk space - Microsoft Windows 98 SE, Windows ME, Windows 2000/XP/2003, Windows Vista, Windows 7,8,8.1
Windows System directory - sgfplib.dll (FDx SDK Pro main module) - sgfpamx.dll (FDx SDK Pro algorithm module, MINEX Certified)
Bin\i386 directory - sgfplib.dll - sgfpamx.dll - sgfplibx.ocx
Bin\x64 directory - sgfplib.dll - sgfpamx.dll - sgfplibx.ocx
Inc directory - sgfplib.h
Lib\i386 directory - sgfplib.lib
Lib\x64 directory - sgfplib.lib
Samples directory - Image capture sample written in Visual Studio 2005 - Matching sample written in Visual Studio 2005 - Matching sample for ANSI-378 template written in Visual Studio 2005 - Matching sample for ISO 19794-2 template in Visual Studio 2005
DotNet\Bin\i386 Directory - SecuGen.FdxSdkPro.Windows.dll (FDx SDK Pro .NET x86 library)
DotNet\Bin\x64 Directory - SecuGen.FdxSdkPro.Windows.dll (FDx SDK Pro .NET x64 library)
DotNet\Samples Directory - Matching sample written in C# (Visual Studio 2005) - Matching sample showing ANSI 378 template usage written in C# (Visual Studio 2005) - Matching sample written in Visual basic .NET (Visual Studio 2005)
Upvotes: 1
Views: 9725
Reputation: 63
If you run to this issue in windows application especially in production check if microsoft c++ redistributable is installed.Had to install 2015 it works.
Upvotes: 0
Reputation: 7
I accidentally have two accounts. The first thing is yes you do have to be sure are installing the SDK on the proper bit server. I ended up taking the active-x controls and embedding them into the web form. Then when the fingerprint was captured and it was converted to a string which was sent via ajax to the server.
I then ran into an issue where the SDK did not have a function to properly de-crypt the string for comparison. I contacted Secugen and they were awesome about getting my request to an engineer which then supplied me with another .dll file which contained the missing functions. One of these days I'll probably post up some source code on GitHub. When I do I'll update this with the link!
Upvotes: 0
Reputation: 64
Make sure that your application is built in 32-bit platform target
Upvotes: 2