Invalid MSSQL Cast Exception on Cloud Sites
Cloud Sites Windows clusters have the MSSQL 2012 data types installed (assembly version 11.0) in addition to the MSSQL 2014 data types (assembly version 12.0). This may introduce errors for some custom applications.
In particular you may see this error when referencing SQLTypes from assembly version 11.0:
System.InvalidCastException: Unable to cast object of type 'Microsoft.SqlServer.Types.SqlGeometry' to type 'Microsoft.SqlServer.Types.SqlGeometry'.
You can work around this known issue in your code by specifying a value of “SQL Server 2012” for the “Type System Version” attribute in your connection string. If you encounter this error, your developer will be able to advise you on the best way to modify your application.
Each application is different, and we are unfortunately unable to help you troubleshoot your application or website code. However, Microsoft provides comprehensive information about all of their APIs, including code examples. Specifically, you can see code examples in Breaking Changes to Database Engine Features in SQL Server 2012.