How to programmatically install integrated Windows authentication in IIS on a .NET web service?

I have a web service project that needs to be installed in order to use integrated Windows authentication after installation. I usually install a web service and then manually go into IIS and make sure the check box is selected for Integrated Windows Authentication. There must be a way to do this with code. I looked at using the Installer class. It seems like this is something I could use, but I did not find anything when setting properties programmatically in IIS.

+4
source share
2 answers
String applicationPath = String.Format("{0}/{1}", _server.Sites["Default Web Site"].Name, "AppName"); Configuration config = _server.GetApplicationHostConfiguration(); ConfigurationSection anonymousAuthenticationSection = config.GetSection("system.webServer/security/authentication/anonymousAuthentication", applicationPath); anonymousAuthenticationSection["enabled"] = false; ConfigurationSection windowsAuthenticationSection = config.GetSection("system.webServer/security/authentication/windowsAuthentication", applicationPath); windowsAuthenticationSection["enabled"] = true; _server.CommitChanges(); 
+3
source

Take a look at WebDeploy . This technology was developed by MS for web application deployment .; -)

0
source

Source: https://habr.com/ru/post/1307255/


All Articles