In my db table Layout, there\'s one column whose type is hierarchyid (column index=4).
When trying to set-up new environment (a virtual web-server, created from
Rather than changing your project and adding a reference to Microsoft.SQLServer.Types dll you could just put it into the GAC.
In my case I had three versions on my dev machine and added them to the server GAC:
gacutil.exe -i .\10.0.0.0__89845dcd8080cc91\Microsoft.SqlServer.Types.dll
gacutil.exe -i .\11.0.0.0__89845dcd8080cc91\Microsoft.SqlServer.Types.dll
gacutil.exe -i .\12.0.0.0__89845dcd8080cc91\Microsoft.SqlServer.Types.dll
I had other SQL related third party .NET tools on the server that had the same error. After adding the assemblies to the GAC, they all worked fine.
While I don't put my own assemblies into the GAC, I think it is okay to put some Microsoft SQL-Server assemblies there because they affect multiple applications.