Migrating .net application to iis7

When you initially try to run a web application with IIS7, it’ll bitch at you and tell you to either migrate the application or run it in a classic app pool.  I decided I would migrate my application since I’m sure I’ll have little choice in the future.  The error page is fairly convenient and tells you which command to run to migrate the website:

%systemroot%system32inetsrvAPPCMD.EXE migrate config “Default Web Site/YourApp”

This is great and all, but when I tried to run the command, I received the following error:

ERROR ( message:Configuration error
Filename: \?C:Windowssystem32inetsrvconfigapplicationHost.config
Line Number: 0
Description: Cannot read configuration file
. )

Now, first let me congratulate Microsoft on their extremely informative error message.  Not to mention the creativity used for formatting the error message. Way to go!  After staring at the monitor for a while, I figured that I would try running the cmd.exe as an administrator.  This solved the issue, and everything is happy.

One way to run the cmd.exe as administrator is by going through the start menu, right click Command Prompt and select Run As Administrator.  Executing the migration command in the administrator command prompt will successfully migrate your website.