I was wondering if anyone has come across the following error message. I receive the error message, "The type initializer for 'xxxxx.Domain.Repository '1' threw an exception". The error occurs when I run the following code:
var allLocations = db.TblProjectLocations.All();
When I test this locally (with a mdf database file), I don't receive this error message and everything works fine. This error started to occur when I began testing my code on the web server.
Here's my connection string as it appears in the web.config:
<add name="Project" providerName="System.Data.SqlClient" connectionString="Data Source=dbServer;Initial Catalog=DatabaseApps;Persist Security Info=True;User ID=userId;Password=secret"/>
Any assistance would be greatly appreciated.