locked
Deployment bug: Class not registered RRS feed

  • Question

  • User591767183 posted

    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.

    Thursday, November 16, 2006 10:48 AM

Answers

  • User591767183 posted

    Several have asked how I resolved this.  Since it was so long ago, it took me a while to track this down (I haven't done ASP.NET programming in about 4 years).  Apparently the answer is as follows:

     In the application pool that the web app was assigned to, I had set the identity to the "IWAM_" account.  I changed it to "Local System", and this is all that was needed.

    See my thread in another forum:

    http://www.tek-tips.com/viewthread.cfm?qid=1302878&page=2

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, February 17, 2010 6:59 PM

All replies

  • User419425978 posted
    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.
    Friday, November 17, 2006 11:44 AM
  • User591767183 posted

    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.

     

    Friday, November 17, 2006 1:28 PM
  • User-1291101065 posted

    Hi, Did you manage

    to find out what the issue was? I am facing the exact same problem.

    the windows app  works but a web app does not ...

    Thursday, August 14, 2008 10:18 PM
  • User84926151 posted

     Hi

    I am facing the same problem. Can you resolved the issue ?.

    Kindly send me some tips.It will help us to resoluve the issue.

    Regards

    Arula

     

    Wednesday, September 2, 2009 11:40 PM
  • User591767183 posted

    Several have asked how I resolved this.  Since it was so long ago, it took me a while to track this down (I haven't done ASP.NET programming in about 4 years).  Apparently the answer is as follows:

     In the application pool that the web app was assigned to, I had set the identity to the "IWAM_" account.  I changed it to "Local System", and this is all that was needed.

    See my thread in another forum:

    http://www.tek-tips.com/viewthread.cfm?qid=1302878&page=2

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, February 17, 2010 6:59 PM
  • User198583069 posted

    Switching the identiy to local system did not work for me.

    My application runs fine on my testing Windowx XP but when deploying to Windows Server 2003 it wont run.

    On VS2005 on my test machine i just add a COM Reference.

    I would need to find out what this is doing in the background and then just do this reference setting on the deployment server manually.

    Does anybody has any idea?

    Friday, September 3, 2010 8:32 PM