Home ยป How To Guides | Technology

Upgrade GoDaddy Windows Hosting to ASP.NET 4.0 : Issues And Solution

  29. May 2011 by Soan

This blog runs on GoDaddy and uses asp.net 3.5. I recently upgraded my windows hosting account to GoDaddy's 4G hosting and wrote about the issues and solutions here. Upgrading to 4G hosting automatically upgrades your IIS to version 7.0 and you have to make some tweaks to web.config to make it work.

This time I upgraded my asp.net 3.5 to asp.net 4.0 and again faced some issues. Here are the solutions to common problems so that you can jump start your upgrade process. Moving to asp.net 4.0 from asp.net 2.0 or 3.5 is easy and not much problematic as 4.0 is backward compatible. hence, most of the features are supported. But, there are some minor changes that are required to get things work.

How to upgrade your GoDaddy account to asp.net 4.0?

  1. Log in to your GoDaddy hosting account and go to 'Hosting Control center'. Then Click on 'Content'->'Programming languages' tab as shown in image below:
    Select programming language
  2. Now select asp.net 4.0 and click 'Continue' button. You are done. Your account will now have asp.net 4.0 framework activated.
    Upgrade to 4.0

What should I do to port my existing website to asp.net 4.0?

  1. Make sure that the application currently targets ASP.NET 3.5. To upgrade a Web application that is earlier than the .NET Framework 3.5, you must first convert the application to the .NET Framework 3.5.
  2. Open the Web.config file in the application root.
  3. In the configSections section, remove the sectionGroup element that is named "system.web.extensions". Remove any other child tags that are written inside the "system.web.extensions" tag too.
  4. In the system.web section, in the compilation collection, remove every add element that refers to an assembly of the .NET Framework.
    Framework assemblies generally begin with "System.". Typically these have Version=3.5.0.0 in the assembly attribute. However, some assembly entries that have the 3.5.0.0 version number might refer to assemblies that were installed as part of add-on releases, or to custom assemblies. Do not delete these. If the Web.config file contains any of these references, you must investigate them individually to determine whether a later version is available and whether the version reference must be changed.
  5. Add a targetFramework attribute to the compilation element in the system.web section:

    <compilation targetFramework="4.0">

  6. In the opening tag for the pages section, add a controlRenderingCompatibility attribute:

    <pages controlRenderingCompatibilityVersion="3.5"/>

  7. In the system.codedom section, in the compilers collection, remove the compiler elements for c# and vb.
Thats's it. Your web.config is ready to work with asp.net 4.0. Upload it on your website's root on GoDaddy and run your website. If there are no errors, the website will load fine.

In case you see a 500 internal error page instead of your website, then you should first add some debug tags to see the actual error.

The most common cause of this error is that there are some modules in web.config file which are added twice. If that is the case, you should just put a remove tag with the name of that module to resolve the error. Example:

<remove name="URLrewiter">

Let me know if you face any issue and i would be glad to help you.

Would you like to share this article?

QR Code for this page Scan this QR code to open this
article in any mobile browser
or share with friends.


For more helpful articles like this, subscribe to our free newsletter or stay connected on social networks:

SUBSCRIBE
Subscribe to AM22 tech in Reader or by Email
Sign up for our updates in Email (Free):

 

Have questions? Write into comments or ask in forum