What other things does Microsoft.SqlServer.Types give you, besides spatial data?

%3CLINGO-SUB%20id%3D%22lingo-sub-2034744%22%20slang%3D%22en-US%22%3EWhat%20other%20things%20does%20Microsoft.SqlServer.Types%20give%20you%2C%20besides%20spatial%20data%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2034744%22%20slang%3D%22en-US%22%3E%3CP%3EWhere%20I%20work%20my%20colleagues%20have%20had%20a%20habit%20of%20including%20the%20Microsoft.SqlServer.Types.dll%20into%20every%20new%20Windows%20application%20we%20start.%20After%20a%20while%20including%20that%20DLL%20would%20cause%20us%20problems%20when%20our%20users%20tried%20to%20install%20any%20of%20our%20apps%20using%20ClickOnce.%20The%20reason%20for%20that%20is%26nbsp%3BMicrosoft.SqlServer.Types.dll%20needs%20to%20be%20installed%20in%20the%20GAC%2C%20which%20ClickOnce%20won't%20do.%20(%3CA%20href%3D%22https%3A%2F%2Fsocial.msdn.microsoft.com%2FForums%2Fen-US%2F9cdc03c7-2173-4686-8f97-f1fe9224eb5f%2Fclickonce-microsoftsqlservertypes-must-be-installed-in-the-gac%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%22%3EHere's%20one%20link%20describing%20this%20issue%3C%2FA%3E.%20You%20can%20find%20others%20by%20searching%20for%26nbsp%3BMicrosoft.SqlServer.Types.dll%20and%20ClickOnce.)%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHowever%2C%20my%20colleagues%20are%20adament%20about%20having%20that%20DLL%20in%20our%20apps.%20I%20looked%20up%20what%26nbsp%3BMicrosoft.SqlServer.Types.dll%20is%20for%20and%20discovered%20that%20it%20is%20for%20spatial%20data%20types%20that%20are%20in%20SQL%20Server%20but%20are%20not%20native%20to%20C%23%20(or%20presumably%20VB.NET).%20And%20we%20don't%20have%20any%20data%20types%20that%20have%20native%20SQL%20Server%20spatial%20data%20types%20in%20them.%20So%2C%20I%20am%20still%20not%20sure%20why%20my%20colleagues%20insist%20upon%20including%20a%20DLL%20that%20does%20nothing%2C%20at%20least%20as%20far%20as%20I%20know.%20Nevertheless%2C%20the%20insist%20that%20it%20must%20be%20included.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESo%2C%20I'd%20like%20to%20ask%20what%20else%20does%26nbsp%3BMicrosoft.SqlServer.Types.dll%20do%2C%20besides%20work%20with%20SQL%20Server's%20native%20spatial%20data%20types%3F%20Here's%20a%20line%20of%20code%20that%20we're%20having%20problems%20with%2C%20because%26nbsp%3BMicrosoft.SqlServer.Types.dll%20is%20no%20longer%20a%20part%20of%20the%20project%20(so%20that%20users%20can%20use%20ClickOnce%20to%20install%20the%20application)%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-csharp%22%3E%3CCODE%3ESqlServerTypes.Utilities.LoadNativeAssemblies(AppDomain.CurrentDomain.BaseDirectory)%3B%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3EThere%20must%20be%20other%2C%20incidental%20things%2C%20that%20call%20does%2C%20besides%20needing%20to%20be%20called%20before%20doing%20any%20spatial%20data%20type%20actions%20from%20SQL%20Server.%20What%20else%20does%20it%20do%3F%20(This%20call%20is%20in%20a%20method%20which%20helps%20to%20generate%20a%20PDF%20file%20for%20the%20user.)%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2034744%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3Eclickonce%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ESQL%20Server%202016%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Contributor

Where I work my colleagues have had a habit of including the Microsoft.SqlServer.Types.dll into every new Windows application we start. After a while including that DLL would cause us problems when our users tried to install any of our apps using ClickOnce. The reason for that is Microsoft.SqlServer.Types.dll needs to be installed in the GAC, which ClickOnce won't do. (Here's one link describing this issue. You can find others by searching for Microsoft.SqlServer.Types.dll and ClickOnce.)

 

However, my colleagues are adament about having that DLL in our apps. I looked up what Microsoft.SqlServer.Types.dll is for and discovered that it is for spatial data types that are in SQL Server but are not native to C# (or presumably VB.NET). And we don't have any data types that have native SQL Server spatial data types in them. So, I am still not sure why my colleagues insist upon including a DLL that does nothing, at least as far as I know. Nevertheless, the insist that it must be included. 

 

So, I'd like to ask what else does Microsoft.SqlServer.Types.dll do, besides work with SQL Server's native spatial data types? Here's a line of code that we're having problems with, because Microsoft.SqlServer.Types.dll is no longer a part of the project (so that users can use ClickOnce to install the application):

 

SqlServerTypes.Utilities.LoadNativeAssemblies(AppDomain.CurrentDomain.BaseDirectory);

There must be other, incidental things, that call does, besides needing to be called before doing any spatial data type actions from SQL Server. What else does it do? (This call is in a method which helps to generate a PDF file for the user.)

0 Replies