IIS/ASP.net Troubleshooting Cheatsheet
Setting up IIS usually results in some error (403, 500...) at first. Since I run into this a lot and always forget to write down the steps, here's my cheatsheet now, which I'll update if I run into additional issues.
Folder Permissions
- Give
IIS_IUSRS
Read permission to the folder containing your code. - If StaticFile throws a 403 when accessing static files, also give
IUSR
permission - Make sure files aren't encrypted (Properties => Advanced)
If your code modifies files in that folder (e.g., using the default identity database or logging, etc.), you might need write permissions as well.
Registering ASP.net with IIS
If installing .net Framework after IIS, need to run one of these:
- Windows 7/8/2012:
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\aspnet_regiis.exe -i
- Windows 10:
dism /online /enable-feature /all /featurename:IIS-ASPNET45