Deployment bug: Class not registered

Last post 11-17-2006 1:28 PM by PlanDev. 2 replies.

Sort Posts:

  • Deployment bug: Class not registered

    11-16-2006, 10:48 AM
    • Loading...
    • PlanDev
    • Joined on 07-22-2005, 11:45 PM
    • Posts 40

    I deployed my web app from my development machine (WinXP Pro) to the production server (Windows 2003).  Everything works except for a COM library I am referencing from my business object.

     The references in my solution are:

    Web Project --->  Business Layer Project (DLL)  ---> COM Library

    I suspect part of my problem is I didn't properly deploy, I just grabbed everything under \wwwroot\MyWebApp and copied it to the server.  I'm going to be researching proper deployment strategies, but in the meantime maybe someone could give me suggestions.

     In my error log, the exception source is "Interop.AccpacCOMAPI", and the message is "Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG))" and the stack trace is as follows:

    at AccpacCOMAPI.AccpacSessionClass.Init(String ObjectHandle, String AppID, String ProgramName, String AppVersion) at WSTimesheets.AccPacWrapper.GetAccPacEmployeeList(Guid AppUserID) in C:\Documents and Settings\Joe\My Documents\Visual Studio 2005\Projects\WellServe\BusLogic\WSTimesheets\AccPacWrapper.cs:line 239

    Here is a snippet of the code:

    1                // Open a session to AccPac
    2                bool sessionOpened = false;
    3                bool linkOpened = false;
    4                AccpacCOMAPI.AccpacSession accpacSession = null;
    5                AccpacCOMAPI.AccpacDBLink dbLinkRead = null;
    6                AccpacCOMAPI.AccpacView viewEmployees = null;
    7    
    8                string apAppID = AppID;
    9                string apProgramName = AppName;
    10               string apVersion = AppVer;
    11               string apUserID = UserID;
    12               string apPassword = UserPassword;
    13               string apDatabaseID = DatabaseID;
    14   
    15               accpacSession = new AccpacCOMAPI.AccpacSession();
    16   
    17               try
    18               {
    19                   accpacSession.Init("", apAppID, apProgramName, apVersion);
    20                   accpacSession.Open(apUserID, apPassword, apDatabaseID, DateTime.Today, 0, "");
    21                   sessionOpened = true;
    22               }
    23               catch (Exception e)
    24               {
    25                   ErrorLogger errLog = new ErrorLogger();
    26                   errLog.LogException(e, AppUserID, "AccPacWrapper.GetAccPacEmployeeList() - failed to open AccPac session");
    27               }
    

     Line 19 is where the stack trace indicates the error is occurring.

  • Re: Deployment bug: Class not registered

    11-17-2006, 11:44 AM
    • Loading...
    • royv
    • Joined on 07-15-2002, 3:33 PM
    • Posts 56
    If you just literally copied everything over, then yes there is a step you forgot for the COM object.  COM objects require registration, and this is done via the regsvr32 tool in Windows.
  • Re: Deployment bug: Class not registered

    11-17-2006, 1:28 PM
    • Loading...
    • PlanDev
    • Joined on 07-22-2005, 11:45 PM
    • Posts 40

    The COM object is already registered on this server.  I've tested this with a mini-VB program that calls the same method that is causing the exception in my web app.  The VB program can call the method fine.  I'm now working on the assumption that this is a security issue, that I need to give rights to some folder the COM object uses to the IUSR_ or ASPNET account.  That was the solution to a similar problem I had 6 months ago when writing a web service using the same COM object.  However, my previous solution isn't working in this case.

     

Page 1 of 1 (3 items)