Showing posts with label publish web application. Show all posts
Showing posts with label publish web application. Show all posts

Wednesday, 28 March 2012

Test Deployment to IIS

Up until now I've been testing the application through visual studio's built in web app host. I thought now would be a good time to attempt a deployment to the local IIS instance. I used visual studio's publish feature to get it installed. As the project is a web application as opposed to a web site, I needed to check a box to 'Mark as IIS application on destination'. This also has the effect of adding the application to the Default App Pool.

There were a few other things that I needed to do to get the application running. Firstly I had to change the app pool to run under .NET framework 4. Secondly I had to set up IIS APPPOOL\DefaultAppPool to have read/write access to the development database for the project. I'll set up a special test database for this later.

Once I got these things set up, I could run the application, but there were some issues with some resources not being found. These fell into the following categories:
  • File was set as BuildAction - None, so didn't get deployed
  • Controller action not found. This was fixed by using Url.Action helper to generate the url rather than use a relative path.
  • JS and CSS not being picked up. This was fixed by using Url.Content to generate the url rather than use a root based path.