GoDaddy Tips and Tricks for ASP.NET MVC Web Sites

This miniature troubleshooting guide will help developers who upload ASP.NET MVC web sites to GoDaddy.

February 1st, 2011 at 6:00am — Comments: (4) — By: Jonathan Danylko — Tags: Developers

Server Room

When you first start using GoDaddy with WebForms, everything seems simple...you write your site, you upload your changes, attach your connection strings, and immediately test the site. Sometimes things don't go as smooth as you want them to when working with external web hosting companies.

Recently, I've been working on another personal web site and using ASP.NET MVC 2 with Entity Framework 4. Along with finishing up the coding, I've uploaded a "Coming Soon" page to let my users know that I'm almost done with it (and just to get some subscribers signing up).

After going through some trials and tribulations with GoDaddy with ASP.NET MVC, I thought I'd share some of the issues I came across while trying to upload the new web site.

Setting Up Your Account for .NET 4.0

After signing into your account, you want to change your account to use:

  • Hosting
  • Web
  • Deluxe
  • on Windows
  • (and how you want to be charged...monthly, yearly, etc.)

After that is set up, you need to head to your "Hosting Dashboard'. Go under Content and click on Add On Languages.

Go Daddy Add-On Languages

 

Select ASP.NET 4.0 and click Continue.

Go Daddy ASP.NET 4.0 Settings

Your site should now work with ASP.NET 4.0.

This isn't your dad's Classic web site!

Once that is complete, you can move on to changing the type of IIS mode you'll be using with your MVC site. Excuse the pun, but this was a "classic" mistake.

In your "Hosting Dashboard" again, click Content, then IIS Management.

Click on the Advanced button and a panel will slide open revealing either Classic or Integrated. Click Integrated and click OK.

Go Daddy Classic or Integrated Radio Button

Your ASP.NET MVC 2 application can now be uploaded to GoDaddy using the FTP information they sent you when you set up your hosting account.

You have a Farm and you don't even know it.

GoDaddy works with multiple servers, or clusters of web servers (or web farms). When you are given a hosting account, they provide a space on their server along with other users who own web sites. If you want to pay for a dedicated server when you receive a lot of traffic, go for it.

The reason I mentioned this was because I received an error when I tried to bring up my web site:

"Validation of viewstate MAC failed. If this application is hosted by a Web Farm or cluster, ensure that configuration specifies the same validationKey and validation algorithm. AutoGenerate cannot be used in a cluster."

Solution: Fix this by creating a MachineKey for your web.config. If you need to create one, one such utility exists here. You want to use the 2.0 version and just copy and paste it right below your opening  <system.web> tag like so:

 <system.web>

	<machinekey ...

Sheesh...Are we done yet?

Almost. One last thing I ran into was using different data types on GoDaddy that I wasn't using in my local schema. Huh?

I received the following error when I tried to view the "Coming Soon" page:

The version of SQL Server in use does not support datatype 'datetime2' or 'date'.

I scoured every piece of code that accessed the schema structure that I transferred over to GoDaddy and I couldn't find any place where I was setting a column to datetime2 or date. Then it hit me...is GoDaddy using the same database as I am?

Personally, I was using 2008 RC2 with the Entity Framework 4 (Model design first). I thought that everything would be compatible when transferring the site over to GoDaddy. Wrong! They are using SQL Server 2005.

To solve this problem, locate the ProviderManifestToken attribute near the top of your edmx file (EF4 files) and change it from 2008 to 2005. Recompile and Deploy.

Conclusion

When I got everything running, I was quite pleased...and not even a call to support. While developers may have an idea of how to fix certain programming issues, it may take them a little longer to figure out web configuration management...especially with a web hosting company.

I hope that these tips and tricks will help someone else out in the long run.

Also, if you're interested, hop over to my new site I'm working on. I will be talking about some of the MVC features in a future post.

Do you have any GoDaddy tips or tricks? Post them below in the comments.

Picture of Jonathan Danylko
  • Jonathan Danylko Twitter Account LinkedIn Account Facebook Account

Jonathan Danylko is a freelance web architect and avid programmer who has been programming for over 20 years. He has developed various systems in numerous industries including e-commerce, biotechnology, real estate, health, insurance, and utility companies.

When asked what he likes doing in his spare time, he answers..."programming."

Related Posts

4 Comments

  1. March 21st, 2011 at 6:44am
    Also, if anyone is having problems with ASP.NET MVC 3, Bill Krat has a great post on having troubles with installing MVC 3 sites on a Windows Server without MVC.

    Deploying ASP.NET MVC 3 with Razor to a Windows Server without MVC installed.
    http://www.global-webnet.net/blogengine/post/2011/03/19/Deploying-ASPNET-MVC-3-with-Razor-to-a-Windows-Server-without-MVC-installed.aspx
  2. Manish
    March 22nd, 2013 at 1:06pm
    can you please share the screenshot of the folder structure after uploading to Godaddy.

    My mvc3 website is not coming up. i wonder, all the folder after publish goes under [root] of the Html directory.

    is that correct.

    please share the screenshot if possible
  3. March 25th, 2013 at 7:36am
    @Manish, Yes, it should be uploaded into the Html directory exactly how it's published.

    An additional tip is to first publish it to a local folder (or local IIS) to verify that everything is the way you want it before uploading to GoDaddy.

    Hope this helps.
  4. November 8th, 2013 at 12:06pm
    Guys,

    The above mentioned URL is my website developed in MVC3.0, using Visual studio 2012, and i had uploaded it into Godaddy servers, but alas, the coding is not working. Need help.

    THanks//!!

Post a comment