locked
Getting Error: Retrieving the COM class factory for component with CLSID {XXXX} failed due to the following error: 80040154 RRS feed

  • Question

  • Dear All,

     

    I am getting an error while trying to debug the following code:

     

     

       private void tempSiteInfo()

            {

                SPSecurity.RunWithElevatedPrivileges(delegate()

                   {

                       SPWeb spWeb = SPContext.Current.Site.OpenWeb(); --- Get exception Here 

     

                   });

            }

     

    I have created an infoPath form and generate the code from InfoPath Code Editor on SharePoint Server 2010 x64 bit.

    And I have gone through some forum and got some solution like some peoples are telling that we should make our Project Trget to x64 Bit if it is x86 bit.

    But in my case i did not get the project traget tab in Build Tab of my project because this solution is generated by InfoPath.

    Please Help me on this issue. I am stuck because of this, So Please anybody help me on this.

    Please find below the exception description what i am getting.

     

    InfoPath cannot open the selected form because of an error in the form's code.

    System.Runtime.InteropServices.COMException, mscorlib

     

    System.Runtime.InteropServices.COMException (0x80040154): Retrieving the COM class factory for component with CLSID {BDEADF26-C265-11D0-BCED-00A0C90AB50F} failed due to the following error: 80040154.

       at Microsoft.SharePoint.Library.SPRequest..ctor()

       at Microsoft.SharePoint.SPGlobal.CreateSPRequestAndSetIdentity(SPSite site, String name, Boolean bNotGlobalAdminCode, String strUrl, Boolean bNotAddToContext, Byte[] UserToken, String userName, Boolean bIgnoreTokenTimeout, Boolean bAsAnonymous)

       at Microsoft.SharePoint.SPRequestManager.GetContextRequest(SPRequestAuthenticationMode authenticationMode)

       at Microsoft.SharePoint.Administration.SPFarm.get_RequestAny()

       at Microsoft.SharePoint.SPSecurity.GetCurrentUserTokenNoApplicationPrincipalDelegated()

       at Microsoft.SharePoint.SPSecurity.GetCurrentUserToken()

       at Microsoft.SharePoint.SPSecurity.EnsureOriginatingUserToken()

       at Microsoft.SharePoint.SPSecurity.RunWithElevatedPrivileges(WaitCallback secureCode, Object param)

       at Microsoft.SharePoint.SPSecurity.RunWithElevatedPrivileges(CodeToRunElevated secureCode)

       at CMSForm24Jan.FormCode.tempSiteInfo() in C:\Users\administrator.TEST\Desktop\CMSForm27Jan12\CMSForm24Jan1\FormCode.cs:line 126

       at CMSForm24Jan.FormCode.InternalStartup() in C:\Users\administrator.TEST\Desktop\CMSForm27Jan12\CMSForm24Jan1\FormCode.cs:line 121

       at CMSForm24Jan.FormCode.FinishInitialization() in C:\Users\administrator.TEST\Desktop\CMSForm27Jan12\CMSForm24Jan1\FormCode.Designer.cs:line 54

       at Microsoft.Office.InfoPath.XmlFormHostItem.Microsoft.VisualStudio.Tools.Applications.Contract.IEntryPointContract.FinishInitialization()

       at Microsoft.VisualStudio.Tools.Applications.EntryPointAdapter.Microsoft.VisualStudio.Tools.Applications.Contract.IEntryPointContract.FinishInitialization()

     

     

     

    Friday, January 27, 2012 7:39 AM

All replies