SqlTypes
От: -rsdn- Беларусь http://dsalodki.wix.com/resume
Дата: 10.10.17 07:04
Оценка:
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>
Re: конфликт сборок
От: Codechanger Россия  
Дата: 10.10.17 07:50
Оценка:
Здравствуйте, -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 файл генерит при установке
Re[2]: конфликт сборок
От: -rsdn- Беларусь http://dsalodki.wix.com/resume
Дата: 10.10.17 08:16
Оценка:
Здравствуйте, 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"));
Re[3]: конфликт сборок
От: -rsdn- Беларусь http://dsalodki.wix.com/resume
Дата: 10.10.17 12:20
Оценка:
Здравствуйте, -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>
 
Подождите ...
Wait...
Пока на собственное сообщение не было ответов, его можно удалить.