locked
Trying to use spatial data retreived from SQL Azure in .NET with v11.0 RRS feed

  • Question

  • I have a VS2010 web application that has various projects/layers behind it as references. I recently changed from v10 to v11 for my Microsoft.SQLServer.Types (using geography types) because a new version of a third party mapping tool I am using requires this version. I am getting the following exception in my data layer when I try to retreive some geogprahy data and pass to a variable. I can not find anything left in my projects referencing v10. I am using SQL Azure for my database. I found the Type System Version setting in the connection string and tried changing this to 2012, but this did not help. When I debug locally I get the exception upon access of the geography data. In Azure, it is looking for version 10.0 and can't find it so it just fails at the reference level. Does anyone know what I can do to resolve this issue?

    exception occurs @ 

    Dim geoExtent As Microsoft.SqlServer.Types.SqlGeography = dtAP.Rows(0).Item("IM_Extent")

    [A]Microsoft.SqlServer.Types.SqlGeography cannot be cast to [B]Microsoft.SqlServer.Types.SqlGeography. Type A originates from 'Microsoft.SqlServer.Types, Version=10.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' in the context 'Default' at location 'C:\Windows\assembly\GAC_MSIL\Microsoft.SqlServer.Types\10.0.0.0__89845dcd8080cc91\Microsoft.SqlServer.Types.dll'. Type B originates from 'Microsoft.SqlServer.Types, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' in the context 'Default' at location 'C:\Windows\assembly\GAC_MSIL\Microsoft.SqlServer.Types\11.0.0.0__89845dcd8080cc91\Microsoft.SqlServer.Types.dll'.

    Friday, July 19, 2013 5:26 PM

Answers