My last post covered the removed of Visual Studio 2010 Beta 1 and the subsequent install of Beta 2. In this post I’ll follow on from that and cover the steps taken to upgrade my solution, created in Beta 1, to work with Beta 2.
As it turns out this was a pretty straight forward process but there were a couple of small glitches along the way which I'll cover below. These steps worked for me but they may not work for everyone.
The first job was to make sure the solution compiled in the new .NET framework so I fired up Visual Studio 2010 and opened up the solution I’d been working on. A quick build threw up a few errors all of which were related to ASP.NET MVC. When the solution had been created references to ASP.NET MVC 1.1 had been added to the Web, Tests and Controllers projects (the solution has multiple projects) so those were quickly replaced with references to ASP.NET MVC 2.0. Another build and the solution was compiling without any errors.
With the project compiling I opened up NUnit to make sure all of the business and data logic tests were still passing. All the tests executed successfully so it was time to check out the actual website to see if it was working properly. I know this should probably be done through some sort of unit test but at the moment we don’t have that in place.
I opened up the IIS Management Console and placed the website into the default .NET 4.0 integrated app pool. I normally like to run each application in it’s own app pool but I’ll cover that a bit later on in the post
To get the web site working three changes had to be made within the sites web.config. The first of these was the removal of the targetFrameworkMoniker attribute in the compilation tag.
Secondly the configSection entries added to the web.config by ASP.NET MVC 1.1 had to be removed. In .NET 4.0 Beta 2 these config sections are contained within the machine.config file which causes a duplication error when they are also present in the web.config of your project.
The third and final change to the web.config was to update any reference references for MVC 1.1 to 2.0. Remember to also change the web.config in the views folder.
At this point the result was a fully functioning website so job done right? Well not quite no. I normally like to have each of my applications running in it’s own app pool so I went back to the IIS Management Console and created a new app pool targeting v4.0.21006 of the .NET Framework (Beta 2) and assigned the website to the app pool.
I thought those changes would just work but every time I visited the site the app pool would stop and the browser would display a 503 service unavailable error. Investigating the event viewer yielded a couple of interesting error messages:
It looks like IIS is trying to load the Beta 1 version of .NET 4.0 and is falling over because it’s not installed which is subsequently causing my app pool to stop running. Looking at the .NET Framework folder within the windows directory showed two folders for .NET 4.0, one for Beta 1 (v4.0.20506) and one for Beta 2 (v4.0.21006).
Having already uninstalled Beta 1 I took a bit of a gamble and deleted the v4.0.20506 folder and then restarted my app pool. Problem solved and now we’re all done.
All told the migration took about 25minutes but most of that was spent head scratching on the app pool problem so I’m very impressed with how well it went. Just as a quick aside ASP.NET MVC now comes as a preinstalled part of Visual Studio so there is no need to download and install a separate add on.
Next up is my first ever install of TFS.
Be the first to rate this post
- Currently 0/5 Stars.
- 1
- 2
- 3
- 4
- 5
visual studio 2010, visual studio 2010, visual studio 2010, visual studio 2010, visual studio 2010, visual studio 2010, visual studio 2010, visual studio 2010, visual studio 2010, visual studio 2010, visual studio 2010, visual studio 2010, visual studio 2010, visual studio 2010, visual studio 2010, visual studio 2010, visual studio 2010, visual studio 2010, visual studio 2010, visual studio 2010, visual studio 2010, visual studio 2010, visual studio 2010, visual studio 2010, visual studio 2010, visual studio 2010, visual studio 2010, visual studio 2010, visual studio 2010, visual studio 2010, visual studio 2010, visual studio 2010