The type initializer for 'System.Data.Entity.Internal.AppConfig' threw an exception on a Sub Website

c# entity-framework entity-framework-6 nuget

Accepted Answer

ZZZ_tmp
4
12/6/2013 9:51:36 PM

Popular Answer

A nested site and EF 4.3.1 gave me trouble.

The problem was caused by what appeared to be duplicates in the connection strings and library utilized by both sites.

<connectionStrings>

Presumably, it was loading the connection strings from the parent site but failing to load the strings from the sub-site.

Add this to your sub-site:

<connectionStrings>
<clear/>
...your normal connection strings
</connectionStrings>


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow