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

How to copy the DXC or Azure EPiServer database to your local Sql Server

You may want to download the EPiServer of a Azure or DXC environment to your local sql database, simply because:

  • The database may be restricted to certain IPs only, thus you are not able to connect to it remotely or without e.g. whitelisting the IP address for each new IP address assigned to your laptop/development environment at home/the vacation resort etc.
  • The database may require you to access it through a VPN. If you are on the wrong continent, traveling, it may be painfully slow to wait for each db query to finish.
  • It’s more fun to have it locally => easy to perform any change, rather than the cumbersome Azure way.

Continue reading

EPiServer – get page property value in a specific language

I’m sending emails from EPiServer, and the email content is based on a language selection coming from the backend. As often the case in EPiServer implementations, I have a separate page for Email Settings and translations. I read the subjects, mail texts and other properties from the [CultureSpecific] properties.

How to do this programmatically? I found lengthy answers on the internet, but I want a short, quick answer. Here is how to get e.g. the Swedish translations:

Continue reading