CryptographicException when impersonating

Questions, comments and suggestions concerning VintaSoft Imaging .NET SDK.

Moderator: Alex

Post Reply
dvonfeldt
Posts: 3
Joined: Wed Apr 28, 2010 11:44 pm

CryptographicException when impersonating

Post by dvonfeldt »

I am recieving the error: CryptographicException was unhandled. The system cannot find the path specified. This is occuring intermittenly while working with the VintasoftImage object when I am impersonating as an elevated user and also when I attempt to use the vintasoft image object after impersonating.

In the below code block it has failed in different spots during different debugging sessions. It has failed on the construction of the VintasoftImage object, the addition of the vintasoftimage object to the imaging.imagecollection, and it has also thrown the exception when setting the oImages imaging.imagecollection to nothing.

Code: Select all

                                Try
                                    oTiffFile = New Tiff.TiffFile(strTempFileToWork)
                                    intOriginalFilePageCount = oTiffFile.Pages.Count
                                    oImages = New ImageCollection
                                    AddHandler oImages.ImageSavingException, AddressOf oImages_ImageSavingException
                                    For i As Integer = 0 To intOriginalFilePageCount - 1
                                        oVImage = New VintasoftImage(oTiffFile.Pages(i).GetImage.GetAsBitmap, True)
                                        oImages.Add(oVImage)
                                    Next
                                    blnRetValue = True
                                Catch ex As Exception
                                    m_strLastError = "IsValidTifFile : Not able to Read all the pages of the tiff file " & strTiffFileNameWithPath
                                Finally
                                    If oTiffFile IsNot Nothing Then oTiffFile.Dispose()
                                    oTiffFile = Nothing
                                    If oVImage IsNot Nothing Then oVImage.Dispose()
                                    oVImage = Nothing
                                    If oImages IsNot Nothing Then
                                        RemoveHandler oImages.ImageSavingException, AddressOf oImages_ImageSavingException
                                        oImages.Dispose()
                                    End If
                                    Try
                                        oImages = Nothing
                                    Catch ex As Exception

                                    End Try

                                End Try
Alex
Site Admin
Posts: 2305
Joined: Thu Jul 10, 2008 2:21 pm

Re: CryptographicException when impersonating

Post by Alex »

Hello,

What version of Windows do you have?
What line of code generates the exception?

Best regards, Alexander
dvonfeldt
Posts: 3
Joined: Wed Apr 28, 2010 11:44 pm

Re: CryptographicException when impersonating

Post by dvonfeldt »

I am developing in windows 7 and .Net 3.5 sp1

The line of code that generates the error is different during different debugging sessions.

It has failed on the construction of the VintasoftImage object, the addition of the vintasoftimage object to the imaging.imagecollection, and it has also thrown the exception when setting the oImages imaging.imagecollection to nothing. It also has made it through without error.

Let me know if you need more information. Would sending you a .Net sample project help?

Thanks,

Dan
Alex
Site Admin
Posts: 2305
Joined: Thu Jul 10, 2008 2:21 pm

Re: CryptographicException when impersonating

Post by Alex »

Let me know if you need more information. Would sending you a .Net sample project help
Yes, we need to reproduce the problem - test project is welcome.

Best regards, Alexander
Post Reply