This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
Hi, We're moving from SQL Server 2008 to SQL Server 2012. We tried upgrading our solution to use the new (2012) version of Microsoft.SqlServer.Types - but we encountered a couple of different runtime errors. I notice that the LightSpeed 4 source has only the 2008 version of the DLL in its Lib directory.
Regards, John Reference material: The 2008 dll has version number 10.0. 2008 R2 has version number 10.5, and 2012 has version number 11.0 There are documented issues with using the most recent one in .NET apps, with known workarounds. There is information here http://technet.microsoft.com/en-us/library/ms143179.aspx , but it did not help in our case. |
|
|
I'm running the old DLL against an Azure (SQL2012) database in production. I use spatial and hierarchyid. No problems. Just curious: what problems did you see when you upgraded? |
|
|
Chad, The problems depended very much on the machine where the app was being run. On one, we got an error saying 'This operation cannot be completed because the instance is not valid. Use MakeValid to convert the instance to a valid instance'. That was from Microsoft.SqlServer.Types.SqlGeometry. On another machine we got 'NotSupportedException: The method 'STIntersects' is not supported', and that error was from LightSpeed. There are also some other possible errors (which we have not experienced) on the "SQL Server 2012 breaking changes" page which I referred to above. I don't fully understand the source of our errors, and I'm hoping I don't have to - if I can just stick with the old DLL! :-) Thanks for your report of success. John |
|
|
Some of those errors look familiar. As I recall they were data/database related -- had nothing to do with the DLL itself. (They removed the hemisphere limitation on SqlGeography and that means you can't do some operations like a SqlGeometry STIntersectt-ing a SqlGeography. Or something. It's late and that was long ago.) Checking notes I see I had some problems mixing 10.0 and 11.0 DLLs in a MVC app, but the error I saw was clearly inside LightSpeed: [InvalidCastException: Object must implement IConvertible.] during Linq operations. |
|
|
You should be able to use either as we have switched to comparing things by type name rather than directly comparing the types which led to versioning issues previously. Use the 10.0 one if you want to be sure though as this is the one we compile against.
|
|
|
Thanks Jeremy, That's the solution we'll go with - i.e. use 10.0. By the way, we found that we had to put an assembly binding redirect into our config file, to force the app to use 10. I don't think that should have been necessary. I think that somehow, when built on certain machines, the compiler was putting 11.0 into the compiled assembly reference rather than 10.0. Tried using the "specific version" flag, which didn't seem to help. I'm not sure whether there was an error in our testing, or something else that we missed. In any case, with the bindingRedirect in our config file, it does indeed load 10.0, and everything seems to be working OK. Just thought I'd note this here is case its of any use to other readers of this thread in future. |
|