Thursday, May 22, 2008

ASPENCRYPT - Object Already Exists

If you get this error re-install Aspencrypt.

Object already exists.

Server Error in '/' Application.

Object already exists.

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.Runtime.InteropServices.COMException: Object already exists.


Source Error:

Line 66:     Public Shared Function Encrypt(ByVal UserID As String) As String Line 67:         Dim CM As New CryptoManagerClass Line 68:         Dim Context As ICryptoContext = CM.OpenContext("mycontainer", True) Line 69:         Dim key As ICryptoKey = Context.GenerateKeyFromPassword("elphantswanderingacr0ssapl14n", ASPENCRYPTLib.CryptoAlgorithms.calgSHA, CryptoAlgorithms.calg3DES) ' use defaults Line 70:         Dim Blob As ICryptoBlob = key.EncryptText(UserID)

Source File: Line: 68

Stack Trace:

[COMException (0x800a0001): Object already exists. ]    ASPENCRYPTLib.CryptoManagerClass.OpenContext(String Container, Int32 bMachineKey, Object CreateNew) +0    security.Encrypt(String UserID) in C:\Shared\Projects\Schriaz_TMF\SourceControl\Source\Admin.2005\App_Code\security.vb:68    ucontrols.forms.login.LoginAdmin(Boolean blnPersist) in C:\Shared\Projects\Schriaz_TMF\SourceControl\Source\Admin.2005\controls\forms\login.ascx.vb:278    ucontrols.forms.login.CheckLogin() in C:\Shared\Projects\Schriaz_TMF\SourceControl\Source\Admin.2005\controls\forms\login.ascx.vb:223    ucontrols.forms.login.btLoginCen_Click(Object sender, ImageClickEventArgs e) in C:\Shared\Projects\Schriaz_TMF\SourceControl\Source\Admin.2005\controls\forms\login.ascx.vb:584    System.Web.UI.WebControls.ImageButton.OnClick(ImageClickEventArgs e) +86    System.Web.UI.WebControls.ImageButton.RaisePostBackEvent(String eventArgument) +115    System.Web.UI.WebControls.ImageButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7    System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11    System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33    System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1746 


Version Information: Microsoft .NET Framework Version:2.0.50727.1434; ASP.NET Version:2.0.50727.1434

No comments: