Windows Azure Website 32bit and SQL Spatial

azurewebsite

Hit an interesting snag when using Windows Azure Websites recently. We had a solution using MVC4, a bunch of worker roles and did a bit of sql spatial to do intersects, create bouding boxes etc.

Deployed to azure and once we had the correct SQL Server dlls included in the project following Alistair’s great steps we were all good. The workers did their thing and the website was deployed till we tried to do something on the website that used sql spatial…then error!

So after checking, rechecking and checking again we’d deployed the correct dll’s we were a bit baffled. We a bit of investigation on the website and ended up outputting the value of Environment.Is64BitProcess and discovered on the website it was FALSE. What this meant was for our WEBSITE, we had to deploy the 32bit versions of the SQL Spatial dll’s and for EVERYTHING ELSE, deploy the 64bit version. I had a bit of a dig and couldn’t find this wonderful “feature” documented anywhere so hoping this helps someone else in the future.