October 8, 2015

http error 503. the service is unavailable in IIS after enabling 32 bit application

By default, IIS running on a 64 bit computer does not support running a 32 bit application. However, you can change the setting in an Application Pool under which the application is running by setting the ‘Enable 32-bit Applications‘ to true


In IIS, I created a new web-site and change the application pool to enable 32-bit application to support my 32 bit application.

While accessing the apppplication i got the  "HTTP Error 503. The service is unavailable" error.

Also Identified that the application pool was stopped repeatedly when i tried to access the  application. Finally got the below error from event viewer.

The Module DLL ‘C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\isapi\spnativerequestmodule.dll’ could not be loaded due to a configuration problem. The current configuration only supports loading images built for a x86 processor architecture. The data field contains the error number. To learn more about this issue, including how to troubleshooting this kind of processor architecture mismatch error, see http://go.microsoft.com/fwlink/?LinkId=29349.

Solution:
Run the following command in Windows Command Prompt. 


"%systemroot%\system32\inetsrv\AppCmd.exe" set config -section:system.webServer/globalModules
/[name='SPNativeRequestModule'].preCondition:integratedMode,bitness64



This  will solve the problem to load SPNativeRequestModule when the application pool is running in Integrated Mode and 64-bit application mode.

Hope the issue solved !!

October 5, 2015

retrieving the com class factory for component with clsid 80040154 Retrieving the COM class factory for component with CLSID {...} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)

PROBLEM:
When you run the .net Code in X64 Environment you will get the following error message.
" Failed --Retrieving the COM class factory for component with CLSID ...."
E.g. in Retrieving the COM class factory for component with CLSID {94773112-72E8-11D0-A42E-00A024DED613} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)

WORKAROUND:
The possible workaround is modify your project's platform from 'Any CPU' to 'X86' (in Project's Properties, Build/Platform's Target)


ROOTCAUSE
The VSS Interop is a managed assembly using 32-bit Framework and the dll contains a 32-bit COM object. If you run this COM dll in 64 bit environment, you will get the error message.

SOLUTION
  1. Open IIS
  2. Select  the application pool used by your website
  3. Click Advanced setting
  4. enable 32-bit Application to TRUE which was set to False by default.
  5. Restart IIS 
  6. Now its resolved. :)