c# - How do I set up a site in IIS7 on Windows 2008 Server Web SP2 via a console application? -



c# - How do I set up a site in IIS7 on Windows 2008 Server Web SP2 via a console application? -

i have programme i've used on windows server 2003 sets site in iis6 i've used without problems in past.

i'm trying same thing windows 2008 server web sp2 , i'm getting error. i'm guessing has user business relationship security. if correct, there way can around this? thanks.

system.runtime.interopservices.comexception (0x80070005): access denied. @ system.directoryservices.directoryentry.bind(boolean throwiffail)

edit:

i've found microsoft provide assembly, microsoft.web.administration, create task easier iis7. i'm getting error when run application. error reported says:

"the specified https binding invalid".

i'm not specifying https binding though i'm not sure why i'm getting error message. here's code.

using microsoft.web.administration; .... using (servermanager iismanager = new servermanager()) { iismanager.sites.add(site.name.tostring(), "http", "*:80:" + domain, server.inetpath + site.name); iismanager.commitchanges(); site newsite = iismanager.sites[site.name]; newsite.applications[0].applicationpoolname = "trialusers"; iismanager.commitchanges(); }

also, task has update multiple servers in web farm. know how modify code create happen?

iismanager.sites.add(site.name.tostring(), "http:", "*:80:" + domain, server.inetpath + site.name);

remove domain, if you're me didn't add together sec ':' after port

c# iis-7

Comments

Popular posts from this blog

java - How to set log4j.defaultInitOverride property to false in jboss server 6 -

c - GStreamer 1.0 1.4.5 RTSP Example Server sends 503 Service unavailable -

Using ajax with sonata admin list view pagination -