6

In Visual Studio 2010, my solution was using .NET 4.2 (Entity Framework June 2011 CTP) so I could use spatial types in Entity Framework. When I upgraded to Visual Studio 11 Beta, it wouldn't build because of conflicts between the 4.2 and 4.5 framework so I uninstalled 4.2. Now I get this error when I build:

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

Anyone know what this means and what I can do about it? Google yields literally zero results ...

1
  • Is your project targeted to .NET 4.5? Commented Mar 21, 2012 at 8:44

2 Answers 2

22

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

Go to Schema node in ConceptualModels and change this:

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

to add the attribute, like so:

<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">

It is quite annoying this attribute is not editable.

Sign up to request clarification or add additional context in comments.

Comments

0

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

5 Comments

Thank you for paraphrasing the error message. Clearly I don't understand what this means or where to find the UseStrongSpatialTypes setting. If I did, I wouldn't have to ask Stack Overflow.
@RaySaltrelli: It's in the entity designer properties window if you click the document background
That particular property is read-only in the Properties panel. Is there a different way to edit it? Am I supposed to be able to edit it?
It's writable for me; I'm not sure why it would be read-only.
Well at least now I know where the setting is. If you modify your answer it'll let me change my vote. I'll remove the down vote.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.