The type initializer for ‘System.Data.Entity.Internal.AppConfig’ threw an exception

I got this error after updating my Visual Studio 2015 project with new Nuget Packages. The login with SqlServerMembershipProvider would not work anymore after the update.

I tried to solve the issue by changing the defaultConnectionFactory as advised in https://stackoverflow.com/questions/17585611/the-type-initializer-for-system-data-entity-internal-appconfig-threw-an-except. Unfortunately it did not help.

Continue reading

Advertisements

Can’t perfrorm Create, Update or Delete operations on Table(..) because it has no primary key

I stumbled upon this logical error after having published a new table in the EPiServer DXC environment and had it deployed to preparation and production. As you may know, you cannot publish changes to the prep and prod databases directly in DXC, due to which I was stranded with having non-functional code just after Friday’s last update window (DXC does not handle update / publish requests on the weekend.)

I simply forgot to add the Primary Key to my table schema. I added it to the integration database and was just about to send a new request to EPiServer managed services when I decided to try to change my .Net code instead. My code was something simple like this:

Continue reading