Building aspx sites with MSBuild
Further to my posts on building aspx sites with MSBuild I had a chat with Simon Calvert and Bradley Bartz from the ASP.NET team. First off the post on aspnet_compiler is it does'nt make use of refresh files, you really need use MSBuild. I was running into problems with this, but Simon and Bradley showed me a way around this. Given the structure in that post we change the web.config to read
<authentication mode="Forms">
<forms name=".ASPXCOOKIEDEMO" />
</authentication>
<authorization>
<allow users="?" />
</authorization>
and the in the directories you want secured the following web.config is placed.
<authorization>
<deny users="?" />
</authorization>
This is read as all directories are open, however to secure a directory we have to do so on a per directory basis. The reasons for this is that in the past you have secured a directory by making it a subweb and telling the root directory which one directly to close off, this still works today but can cause you problems. I was experincing problems with the aspnet_compiler stage of msbuild as it won't compile subwebs only the root web. To get around this we remove the subweb letting the root config file set the defaults and any config files in other directories override. This done and MSBuild is playing nice with web builds again, hooray!