Hello Everybody,

I have a web service that communicates with a dll called Sagem.MorphoKit.dll. This dll further communicates with a USB Dongle plugged on the server for 1-1 fingerprint matching. I deployed the service on the server and when I try to perform matching, I am getting following exception:

An unhandled exception of type 'System.StackOverflowException' occurred in Sagem.MorphoKit.dll

Here's the piece of my snippet, let me know if you need more info.

Code:
        byte[] MK5_CreateTemplate(byte[] WSQ)
        {
            try
            {
                log.Info("** Inside MK5_CreateTemplate() method");

                if (m_coder == null) return null;

                AwWsq wsq = new AwWsq();
                
                log.Info("** Before converting WSQ format");
                wsq.SetInputImage(AwWsqImageFormat.WSQ, WSQ);
                log.Info("** After converting WSQ format");

                int cols = wsq.GetInputImageCols();
                int rows = wsq.GetInputImageRows();

                log.Info("** WSQ Columns := " + cols.ToString());
                log.Info("** WSQ Rows := " + rows.ToString());

                byte[] raw = wsq.GetOutputImage(AwWsqImageFormat.RAW);

                log.Info("** After getting WSQ Image");
                log.Info("** WSQ Image Length := " + raw.Length.ToString());


                wsq.Dispose();

                if (string.IsNullOrEmpty(PadImageAndConvertToGray(ref raw, ref cols, ref rows)))
                {
                    byte[] template = null;
                    try
                    {
                        log.Info("** Before m_coder.Enroll() method");
                        Sagem.MorphoKit.ICoderResult result = m_coder.Enroll(raw, cols, rows, 1);
                        log.Info("** After m_coder.Enroll() method");

                        if (result != null)
                        {
                            template = result.Template;

                            log.Info("** Template Length : " + template.Length.ToString());

                            return template;
                        }
                    }
                    catch (System.Exception ex)
                    {
                        log.Info("** Exception : " + ex.Message);
                        return null;
                    }
                }

                return null;
            }
            catch (Exception ex)
            {
                log.Info("** Exception := " + ex.Message);
                throw ex;
            }
        }
The exception is coming on this line Sagem.MorphoKit.ICoderResult result = m_coder.Enroll(raw, cols, rows, 1);

The strange thing is the same service works good when I run the service in my DEV environment from Visual Studio but when I deploy it on the server and it runs under IIS, it doesn't work.

Any ideas??

Thanks.