'Microsoft.SqlServer.Types' version 10 or higher could not be found on Azure

前端 未结 12 2351
感情败类
感情败类 2020-11-30 23:01

I\'m trying to make a webapi in ASP.NET MVC 4. The webapi used Entity Framework 5 Spatial types and i have wrote a very simple code.

  public List

        
12条回答
  •  挽巷
    挽巷 (楼主)
    2020-11-30 23:53

    In my case (a WebForms App) I solved the problem adding the following lines in the Application_Start of the Global.asax file.

    SqlServerTypes.Utilities.LoadNativeAssemblies(Server.MapPath("~/bin"));
    System.Data.Entity.SqlServer.SqlProviderServices.SqlServerTypesAssemblyName = "Microsoft.SqlServer.Types, Version=14.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91";
    

    I hope it helps someone.

提交回复
热议问题