The exception “The invoked member is not supported in a dynamic assembly” and the Entity framework.

24 בדצמבר 2008

The entity framework is based on mapping files .csdl and ssdl. Those files are actually put in the resource of the assembly where you wrote your EF code. When invoking the entity framework the connection string has to be parsed. The connection string tells the EF in which assembly resource it will find the mapping files. Unfortunately the default value in the connection string for that is ‘*’ . For example: “metadata=res://*/Data.Seating.csdl|res://*/Data.Seating.ssdl|res://*/Data.Seating.msl”  The ‘*’ means all assemblies. It is not a surprise that the EF searched all possible assemblies in the app-domain for the resource that includes the mapping files...