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

Friday, 22 June 2012

Going Live!

It's been a while since I last blogged on the subject of the Lawn Maintenance Calendar, now know simply as Lawn Calendar.  The plan is go live this Sunday.  Although things are pretty much ready, there are a couple of tasks that I need to complete.

Firstly, I need to create a 'down' screen that I can switch on whilst I upload and configure the site.
Secondly, I need to work how how the data migrations are going to work.  The content provider has already uploaded quite a bit of content into the system on the test hoster and I want to use that as the basis for the live database.  That way, the content provider can add images to the existing written content.  Entity framework now has a migration feature which might be just the replacement I need for the existing DropAndCreateOnModelChange strategy that is currently employed.

Update:  The launch went ahead on Sunday after a hive of activity on Saturday.

Down screen

I found that my new hoster already provides this function, so I didn't have to develop it myself this time.  It's not the most beautiful of down pages, but it will do for the time being. 

Data Migrations   

I've moved to using Entity Framework 4.3.1 which includes the migrations feature.  This now allows me to make database enhancements and upgrade without having to lose the contents of the database.  I've been very impressed with it and will be using it's scripting features to upgrade to V2 when the time comes.

Here's some useful links regarding EF 4.3. and migrations:
http://blogs.msdn.com/b/adonet/archive/2012/02/09/ef-4-3-automatic-migrations-walkthrough.aspx
http://blogs.msdn.com/b/adonet/archive/2012/02/09/ef-4-3-code-based-migrations-walkthrough.aspx
http://blogs.msdn.com/b/adonet/archive/2012/01/12/ef-4-3-configuration-file-settings.aspx
http://www.ladislavmrnka.com/2012/03/ef-4-3-migrations-and-existing-database/

Uploading to hoster

This was quite straightforward for the website itself, but the database was a little trickier.  I couldn't find a way of uploading the mdf files and attaching them to the database like I could with the test site hoster. So, the only way I could get the database uploaded was to create an empty database, script and re-create the schema and then import the data using SSIS.

  

Wednesday, 25 April 2012

Next phase

I've now completed the development for phase 1 of the Lawn Calendar.  It's now on the test server where we are going to leave it until we are ready to deploy to a full paid server.

Before we can fully go live, I want to set up the following:
  • www.lawncalendar.co.uk domain name for the site (registered).
  • A forum where users can discuss the application and suggest features and improvements.
  • Search engine optimisation (SEO) so that people can find the application from Google and Bing.
  • Facebook 'like' and Twitter 'tweet' buttons on the application (maybe)
  • Add legal disclaimer, t&c etc
Update:

Forum: now set up at freeforums

Some webpages with royalty free disclaimer, t&c examples:

http://www.businesslink.gov.uk/bdotg/action/layer?r.l1=1073861197&r.l2=1074448560&r.s=tl&topicId=1076141950
http://legal123.com.au/is-it-better-to-have-a-website-disclaimer-or-terms-and-conditions-on-my-website/

There was an issue with uploading images with upper case extensions.  Here's an article that talks about this:

http://forums.asp.net/t/1682158.aspx/1

Tuesday, 24 April 2012

Merging LMC and Content manager

To hand over the LMC to the the testers, I needed to publish the application on a hosting server.  I found one that is free to host for 90 days (3 months).  Eventually, I'll upgrade to a paid service, but this free one will do for now.

One limitation of the free hosting service is that you can only install one application at a time.  The service is intended as an aid for students to learn ASP, so they don't want commercial applications.  So to get around this limitation, I needed to put the content management application in with the main LMC application, so that they shared the same web.config file.  I could then use custom routes to access the content manager.  I also needed a way of specifying different layouts for the LMC and the content manager.   

Here are a couple of links that helped out:

http://www.asp.net/mvc/tutorials/controllers-and-routing/creating-custom-routes-cs
http://stackoverflow.com/questions/5161380/how-do-i-specify-different-layouts-in-the-asp-net-mvc-3-razor-viewstart-file


Once installed, I ran into the old UK vs US dates problem when trying to submit maintenance task data to the controllers.  Found this solution which creates a model binder to handle the date conversion.

http://stackoverflow.com/questions/9821407/mvc3-en-gb-dates-in-get

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.