I have a console app, which is using Microsoft.Web.Administration to remotely manage IIS on remote server (I used this Credentials for ServerManager.OpenRemote - modified ahadmin properties, opened TCP port 135. I also used impersonation). Everything works fine - I can remotely create Sites and App Pools and so on.
But when I'm trying to do the same thing in ASP.NET MVC 4 app, I get this error:
System.Runtime.InteropServices.COMException: Retrieving the COM class factory for remote component with CLSID {2B72133B-3F5B-4602-8952-803546CE3344} from machine "remoteServerIP" failed due to the following error: 80040154 "remoteServerIP".
I know many people get this error, and I saw a lot of posts about it, but nothing worked for me. I tried switching my MVC app to platform target X86 (Retrieving the COM class factory for component with CLSID {XXXX} failed due to the following error: 80040154), on remote machine I enabled full permissions for both HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID{2b72133b-3f5b-4602-8952-803546ce3344} and HKEY_CLASSES_ROOT\CLSID{2b72133b-3f5b-4602-8952-803546ce3344} for the account that I'm using to impersonate. The problem seems to be in some difference between MVC and console apps, but I can't figure out what it is.
I'm on Windows 7 x64, remote server - windows server 2008 R2 x64. There's IIS 7.5 on both machines.