views:

1148

answers:

2

I have a really simple ASP.NET web application and a web setup project that deploys the project output and content files to a virtual directory in IIS.

What I want is for the MSI to automatically disable Anonymouse Access for that virtual folder in IIS.

I suspect it can probably be done by writing some code in a custom action DLL, that would be acceptable, but is there any way to do it within the the settings of the web setup project?

+3  A: 

Taken from technet

The property for anonymous access is unfortunately not available through Web setup projects. For this reason, you must:

  1. Write a custom installer to enable or disable anonymous access.

  2. Pass the necessary parameters from the setup wizard to the installer at run time.

redsquare
+1  A: 

I'm sure you know that you could disallow users who are not authenticated via web.config

<system.web>
<authentication mode="Windows"/>
<authorization>
  <deny users="?"/> 
</authorization>
</system.web>

would do it I think.

DrG