Build error when using VS 11, .NET 4.5 and Entity Framework

In Visual Studio 2010, my solution used .NET 4.2 (Entity Framework June 2011 CTP), so I could use spatial types in the Entity Framework. When I upgraded to the beta version of Visual Studio 11, it will not be created due to conflicts between the card 4.2 and 4.5, so I will remove 4.2. Now I get this error when creating:

Error 209: Currently, spatial types are only supported when used in CSDL files with the UseStrongSpatialTypes annotation with a false value in their root schema element.

Does anyone know what this means and what I can do about it? Google gives literally zero results ...

+6
source share
2 answers

Manually editing the .edmx file worked for me. Open the file in a text or XML editor (you can right-click and open with ...)

Go to the node schema in ConceptualModels and change this:

<edmx:ConceptualModels> <Schema Namespace="MyDataModel" Alias="Self" xmlns="http://schemas.microsoft.com/ado/2009/11/edm"> ... 

to add an attribute, for example:

 <edmx:ConceptualModels> <Schema Namespace="MyDataModel" Alias="Self" xmlns="http://schemas.microsoft.com/ado/2009/11/edm" xmlns:annotation="http://schemas.microsoft.com/ado/2009/02/edm/annotation" annotation:UseStrongSpatialTypes="false"> 

This is pretty annoying, this attribute is not editable.

+21
source

Set UseStrongSpatialTypes to false in the root properties in the EF Designer window.

0
source

Source: https://habr.com/ru/post/911230/


All Articles