Just the other day I decided to install IIS on a development machine I was running Visual Studio 10 on. It had never occurred to me to do this since VS has the built-in web server for debugging. I have been using .Net Framework 4 for a while from this box so it was installed. I was a little surprised I tried to run some code I was working on after the install and got “Parser Error Message: Unrecognized attribute ‘targetFramework’. Note that attribute names are case-sensitive.“. This is a serious insult, I know the tags are case sensitive, haha.
But getting over myself and realizing that ‘targetFramework’ obviously indicates it doesn’t recognize .NET 4 since it was installed before IIS I opted for a bit of searching. I found the documentation for aspn_regiis. Reading through the documentation I found out it was quite an easy command to use. The documentation itself says “The i, ir, iru and enable options are typically the only options that you require in order to register ASP.NET applications with IIS.”. So, I went to the directory of the version of .NET I wanted to register and ran the command with a -i switch (‘install’) it did the trick. What I ended up running was:
Next time I run into this, hopefully I will remember.