I am having the same exact problem. I can query raster properties successfully, but
raster.getValueByLoc(1,1,-83.458047,35.713469) FROM [dbo].[GRSM30DEM]
Returns the same error.
Msg 6522, Level 16, State 1, Line 1
A .NET Framework error occurred during execution of user-defined routine or aggregate "ST_Raster":
System.Runtime.InteropServices.SEHException: External component has thrown an exception.
at _CxxThrowException(Void* , _s__ThrowInfo* )
at ST_RasterCommon.getPixelValueCommon(ST_RasterCommon* , Int32 band, Int32 l, Int32 x, Int32 y, PixelValueArgument* __unnamed004)
at ST_RasterSS.getPixelValue(ST_RasterSS* , Int32 band, Int32 l, Double __unnamed002, Double __unnamed003, Double* __unnamed004)
at ESRI_ArcSDE.STRasterType.ST_Raster.getValueByLoc(SqlInt32 band, SqlInt32 level, SqlDouble x, SqlDouble y)
I too have copied sde.dll into those two directories, same error again. Wonder why the correct configuration instructions aren't included on ESRI help? What other steps are required to get ST_RASTER working correctly?
SDE 10.2.2 SQL 2012 SP1