using (var db = new ServiceEntities())
{
var temp = db.Cities.FirstOrDefault(x=>x.Enabled);
}
System.InvalidOperationException: 'Spatial types and functions are not available for this provider because the assembly 'Microsoft.SqlServer.Types' version 10 or higher could not be found. '
установил через nuget Microsoft.SqlServer.Types
в web.config
прописал
<dependentAssembly>
<assemblyIdentity name="Microsoft.SqlServer.Types" publicKeyToken="89845dcd8080cc91" culture="neutral" />
<bindingRedirect oldVersion="14.0.0.0" newVersion="14.0.0.0" />
</dependentAssembly>
Здравствуйте, -rsdn-, Вы писали:
R>R>using (var db = new ServiceEntities())
R>{
R> var temp = db.Cities.FirstOrDefault(x=>x.Enabled);
R>}
R>
R>System.InvalidOperationException: 'Spatial types and functions are not available for this provider because the assembly 'Microsoft.SqlServer.Types' version 10 or higher could not be found. '
R>установил через nuget Microsoft.SqlServer.Types
R>в web.config
R>прописал
R> <dependentAssembly>
R> <assemblyIdentity name="Microsoft.SqlServer.Types" publicKeyToken="89845dcd8080cc91" culture="neutral" />
R> <bindingRedirect oldVersion="14.0.0.0" newVersion="14.0.0.0" />
R> </dependentAssembly>
Он там еще cs файл генерит при установке
Здравствуйте, Codechanger, Вы писали:
C>Здравствуйте, -rsdn-, Вы писали:
R>>R>>using (var db = new ServiceEntities())
R>>{
R>> var temp = db.Cities.FirstOrDefault(x=>x.Enabled);
R>>}
R>>
R>>System.InvalidOperationException: 'Spatial types and functions are not available for this provider because the assembly 'Microsoft.SqlServer.Types' version 10 or higher could not be found. '
R>>установил через nuget Microsoft.SqlServer.Types
R>>в web.config
R>>прописал
R>> <dependentAssembly>
R>> <assemblyIdentity name="Microsoft.SqlServer.Types" publicKeyToken="89845dcd8080cc91" culture="neutral" />
R>> <bindingRedirect oldVersion="14.0.0.0" newVersion="14.0.0.0" />
R>> </dependentAssembly>
C>Он там еще cs файл генерит при установке
protected void Application_Start()
{
SqlServerTypes.Utilities.LoadNativeAssemblies(Server.MapPath("~/bin"));
Здравствуйте, -rsdn-, Вы писали:
R>Здравствуйте, Codechanger, Вы писали:
C>>Здравствуйте, -rsdn-, Вы писали:
R>>>R>>>using (var db = new ServiceEntities())
R>>>{
R>>> var temp = db.Cities.FirstOrDefault(x=>x.Enabled);
R>>>}
R>>>
R>>>System.InvalidOperationException: 'Spatial types and functions are not available for this provider because the assembly 'Microsoft.SqlServer.Types' version 10 or higher could not be found. '
R>>>установил через nuget Microsoft.SqlServer.Types
R>>>в web.config
R>>>прописал
R>>> <dependentAssembly>
R>>> <assemblyIdentity name="Microsoft.SqlServer.Types" publicKeyToken="89845dcd8080cc91" culture="neutral" />
R>>> <bindingRedirect oldVersion="14.0.0.0" newVersion="14.0.0.0" />
R>>> </dependentAssembly>
C>>Он там еще cs файл генерит при установке
R>R>protected void Application_Start()
R> {
R> SqlServerTypes.Utilities.LoadNativeAssemblies(Server.MapPath("~/bin"));
R>
вот в чем была загвоздка
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Microsoft.SqlServer.Types" publicKeyToken="89845dcd8080cc91" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-14.0.0.0" newVersion="14.0.0.0" />
</dependentAssembly>