If I bounce off the Web site against a SQL Server 2008 database, I need to drop a copy of Microsoft.SqlServer.Types.dll in the Bin directory. As is, it will work. I still do not understand why I would have to do this as the SQL Server should have everything it needs to handle the spatial data type at its level. Why do I need to add this on the Web server?
On the other servers, running against a SQL Server 2008 database, I didn't have to do that.
Additionnally to that, I brought in the library of SQL Server 2012 Microsoft.SqlServer.Types.dll file instead in the Bin directory. As is, it will not work, as by default, the .NET framework 4.0 will always try to use the SQL Server 2008 Microsoft.SqlServer.Types.dll file. So, in this case, some says to update the Web.config file to include a reference to that assembly. Having it there seems to be the way to force the .NET framework to use the SQL Server 2012 Microsoft.SqlServer.Types.dll file but it isn't.
Here is my Web.config file section of the assembly I added:
<assemblies>
<add assembly="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Management, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
<add assembly="Microsoft.SqlServer.Types, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845DCD8080CC91"/>
</assemblies>
By default, the 3rd assembly was not there. I added it in here to force that. But, in the error log, it still says:
"Could not load file or assembly 'Microsoft.SqlServer.Types, Version=10.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)"
So, we can easily see that it still tries to handle the spatial data type with the SQL Server 2008 version of that file instead of taking the one I put in the Bin directory.
Anyone would have an answer to those two situations?