Friday, February 27, 2015

.NET 4.5 MVC With GoDaddy

If you cannot get MVC projects working on GoDaddy (which I was unable to for a good while), then try this.

Firstly note, I can only find a way of publishing to GoDaddy via ftp.

Reinstall all the packages in your project.

update-package -reinstall
I also had to set the trust level to full (see https://support.godaddy.com/help/article/2531/what-trust-level-can-i-use-when-running-asp-net?countrysite=uk)


   
   
   
   
   
 

Doing this allowed my site to work fine

Wednesday, February 25, 2015

Updating Database model with C# code first

The error:
The model backing the '(data context name)' context has changed since the database was created. Consider using Code First Migrations to update the database (http://go.microsoft.com/fwlink/?LinkId=238269).
Solution: Add this line of code into the Global.asax.cs -> Application_Start() method
Database.SetInitializer<(model name)>(null);