I need to access to a distant iis on a remote machine, It actually work fine when I tried to access to it giving an ip+port to my local machine in the browser and iis seems work fine and I can control it with the iis Manager interface.
iis remotely access from my local machine
Ican access to the distant web site
My problem is when I need to use this code (I've already test it and it works perfectly as a localhost) my code threw me this exception :
System.UnauthorizedAccessException: 'Retrieving the COM class factory for remote component with CLSID {2B72133B-3F5B-4602-8952-803546CE3344} from machine RD01 failed due to the following error: 80070005 RD01.'
When I try to debug what the ServerManager return it show me this:
'serverManager.ApplicationDefaults' threw an exception of type 'System.UnauthorizedAccessException'
Note: I've already tried this solution mentioned in the following link, but it does not work
Credentials for ServerManager.OpenRemote
UPDATE
I forgot to mention that I work with Microsoft.Web.Administration.dll v 7.0.0 and my application is a desktop app with WPF