4

インストール後に統合Windows認証を使用するように設定する必要があるWebサービスプロジェクトがあります。通常、Webサービスをインストールしてから、手動でIISに移動し、統合Windows認証のチェックボックスがオンになっていることを確認します。コードを介してこれを行う方法が必要です。私はInstallerクラスの使用について調べました。これは私が使用できるもののようですが、IISでプログラムでプロパティを設定することについては何も見つかりませんでした。

4

2 に答える 2

3
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();
于 2010-08-05T12:10:26.137 に答える
0

WebDeployを見てください。このテクノロジーは、MSによって設計されており、Webアプリを展開します。;-)

于 2010-04-18T07:34:09.650 に答える