Search code examples
iis-7.net-4.5entity-framework-5windows-server

Entity Framework 5 on Windows Server Web (SP2) x64 and IIS7.0


I have a test website running on a test server with Windows Server Web (SP2) installed. I've just installed .NET4.5 on it. In the website (simple ASP.NET webforms from template) I've used Entity Framework 5 Spatial types, very simple code just for testing which runs fine on my local dev machine:

var conn = new DbEntities();
var geo = conn.tbl_SpatialData.First().GeoInfo;
var geom = DbGeometry.FromGml(geo.AsGml());
litText.Text = geom.AsGml();

However on the server it gives me this error:

Spatial types and functions are not available for this provider because the assembly 'Microsoft.SqlServer.Types' version 10 or higher could not be found.

The sql database where it wants to connect is on a different server, and is a SQL Server 2008 -> I am connecting to the same db from my local dev machine.

I've already tried searching for the dll on my local machine, and adding it to the website's bin folder, however it gives me a new error requesting for another dll. I would like to have those dlls installed globally like on my dev machine. What am I missing or should I install on the server?

Thanks in advance!


Solution

  • That assembly and its dependencies are part of SQL Server Managements Objects. This feature must be installed on the server. It should be part of SQL Server's Client Tools or Client Tools SDK.