Using a Sql Server Data Tools project whose target platform is set to one of:
- SQL Server 2008
- SQL Server 2012
- SQL Server 2014
And deploying to (localdb)\Projects or (localdb)\ProjectsV12
Calling a stored procedure that returns a Geometry, Geography or HierachyId type such as:
CREATE PROCEDURE [dbo].[SelectSqlGeometry]
@x Geometry
AS
SELECT @x as y
RETURN 0
The following calling code:
var result = Connection.Query("dbo.SelectSqlGeometry", new { x = geometry }, commandType: CommandType.StoredProcedure).First();
bool isSame = ((bool)geometry.STEquals(result.y));
results in the following exception on the STEquals line.
Microsoft.CSharp.RuntimeBinder.RuntimeBinderInternalCompilerException was unhandled by user code HResult=-2146233088 Message=An unexpected exception occurred while binding a dynamic operation
Source=Microsoft.CSharp StackTrace: at Microsoft.CSharp.RuntimeBinder.RuntimeBinder.Bind(DynamicMetaObjectBinder payload, IEnumerable1 parameters, DynamicMetaObject[] args, DynamicMetaObject& deferredBinding) at Microsoft.CSharp.RuntimeBinder.BinderHelper.Bind(DynamicMetaObjectBinder action, RuntimeBinder binder, IEnumerable1 args, IEnumerable1 arginfos, DynamicMetaObject onBindingError) at Microsoft.CSharp.RuntimeBinder.CSharpConvertBinder.FallbackConvert(DynamicMetaObject target, DynamicMetaObject errorSuggestion) at System.Dynamic.DynamicMetaObject.BindConvert(ConvertBinder binder) at System.Dynamic.ConvertBinder.Bind(DynamicMetaObject target, DynamicMetaObject[] args) at System.Dynamic.DynamicMetaObjectBinder.Bind(Object[] args, ReadOnlyCollection1 parameters, LabelTarget returnLabel) at System.Runtime.CompilerServices.CallSiteBinder.BindCore[T](CallSite`1 site, Object[] args) at System.Dynamic.UpdateDelegates.UpdateAndExecute1[T0,TRet](CallSite site, T0 arg0) at DATailor.Examples.Dapper.SqlClient.Test.AllTypesDAOTest.TestAllTypesDynamic()