Okay, as a starting point for learning .NET i installed Visual Web Developer Express. Even though it gives you the option to test a website with the ‘view in browser’ option (which launches a temporary server at some crazy port eg. locahost:1076), I thought it was essential to be developing on a real IIS server. Not setting up my server properly cause me many hours of greif and confusion.
The catch with using IIS5.1 for developing .NET websites is that it only allows you to setup ONE website (domain.. whatever). As i have setup and developed PHP on Apache Development servers before i thought this would be fine to work in a similar way, and proceeded to setup my different sites (as i did some tests) in a separate folders. Then by using folder browsing i could access the different sites. WRONG!
eg:
d:/website/ ( allow folder browsing to select a site)
d:/website/site1/
d:/website/site2/
and access them as:
http://localhost/
http://localhost/site1/default.aspx
http://localhost/site2/default.aspx
This works fine for Php sites running on Apache as all of you code is custom (or you set a base path). Its wreaks havok with .NET however. Forms authentication in the config.xml errors. the ~/ file addressing errors, which caused me not to use it at first. Every piece of example code that i downloaded had strings of errors. Solution: Virtual Folders
In Explorer you can click on the folder and under properties>web sharing and select ’share this folder’ then give it an alias. The alias is used like this:
http://localhost/alias/
If you have access this alias and a login box appears you need to change the websites permissions (change it form forms authentication to allow your windows user). This can be changed by going to control panel > administrative tools > IIS , then under the default website there should be the alias you’ve created. goto its properties > directory security , and press ‘edit’ on anonymous access and allow anonymous access. This may be insecure, but hey… you dont know anything about servers do you… so i trust you dont care 