EF 6 und räumlicher Typ DbGeography unter Windows Azure

Ich habe ein paar sehr frustrierende Tage damit verbracht, den räumlichen Typ DbGeography auf Windows Azure umzustellen. Ich habe ein Windows Azure-Projekt mit einer Webrolle, in dem ich die DbGeography.Distance () -Methode verwende, um Entfernungen zu berechnen. Funktioniert wie ein Zauber auf meinem lokalen Computer, aber sobald es in Azure veröffentlicht wurde, erhalte ich die Ausnahme:

Search spa  failed message: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.BadImageFormatException: An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)
   at Microsoft.SqlServer.Types.GLNativeMethods.GeodeticDistance(GeoMarshalData g1, GeoMarshalData g2, EllipsoidParameters ellipsoidParameters, Double& result)
   at Microsoft.SqlServer.Types.GLNativeMethods.GeodeticDistance(GeoData g1, GeoData g2, EllipsoidParameters ellipsoidParameters)
   at Microsoft.SqlServer.Types.SqlGeography.STDistance(SqlGeography other)
   --- End of inner exception stack trace ---
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
   at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at System.Data.Entity.SqlServer.SqlSpatialServices.Distance(DbGeography geographyValue, DbGeography otherGeography)
   at System.Data.Entity.Spatial.DbGeography.Distance(DbGeography other)
   at DataAccess.Util.DistanceHelper.GetDistanceDictionary(DbGeography spaLocation)
   at MvcWebRole.Controllers.SpaController.SearchSpa(String searchString)

Ich habe den Blogeintrag verfolgthttp://alastaira.wordpress.com/2011/08/19/spatial-applications-in-windows-azure-redux-including-denali/ Hinzufügen von Verweisen auf Sql.Server.Types und SqlServerSpatial.dll, msvcp100.dll und msvcr100.dll. Thist arbeitete tatsächlich mit EF5 und einem Azure-Website-Projekt, aber nicht jetzt, als ich auf EF6 und ein Cloud-Service-Projekt aufgerüstet habe :(

Antworten auf die Frage(1)

Ihre Antwort auf die Frage