[{"data":1,"prerenderedAt":529},["ShallowReactive",2],{"article-microsoft-sqlserver-types-getting-it-done":3},{"article":4,"tags":152,"previous":167,"next":267},{"id":5,"title":6,"author":7,"body":8,"createdAt":139,"description":140,"extension":141,"img":142,"meta":143,"navigation":144,"path":145,"seo":146,"stem":147,"tags":148,"updatedAt":139,"__hash__":151},"articles\u002Farticles\u002Fmicrosoft-sqlserver-types-getting-it-done.md","Microsoft.SqlServer.Types–Getting it done.","[object Object]",{"type":9,"value":10,"toc":137},"minimark",[11,20,34,102,108,111,116,119,122,133],[12,13,14,15,19],"p",{},"Recently, started working with SQL Server GeoSpatial types. Specifically I am using column type ",[16,17,18],"strong",{},"geography. ","\nAll was working fine when using on localhost web site however after deployment to a test environment, I go the following exception.",[12,21,22,23,26,27,30,33],{},"Initially, I thought something was not installed on the server (could still be) however the following is the exception and the resolution. Exception:",[24,25],"br",{},"\nSystem.InvalidOperationException: Spatial types and functions are not available for this provider because the assembly ",[16,28,29],{},"'Microsoft.SqlServer.Types'",[16,31,32],{},"version 10 or higher could not be found",".",[35,36,41],"pre",{"className":37,"code":38,"language":39,"meta":40,"style":40},"language-html shiki shiki-themes github-light github-dark","at System.Data.Entity.SqlServer.SqlTypesAssemblyLoader.GetSqlTypesAssembly() \nat System.Data.Entity.SqlServer.SqlSpatialDataReader.\u003C.cctor>b__0() at System.Lazy`1.CreateValue() \n--- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Lazy`1.get_Value()\nat System.Data.Entity.SqlServer.SqlSpatialDataReader.GetGeography(Int32 ordinal) at\nSystem.Data.Entity.Core.Common.Internal.Materialization.Shaper.ErrorHandlingValueReader`1.GetValue(DbDataReader reader, Int32 ordinal) at\nSystem.Data.Entity.Core.Common.Internal.Materialization.Shaper.GetSpatialPropertyValueWithErrorHandling[TProperty](Int32 ordinal, String propertyName, String \ntypeName, PrimitiveTypeKind spatialTypeKind) at lambda_method(Closure , Shaper ) Resolution: To include in your project for deployment purposes, \nuse nuget to get Microsoft.SqlServer.Types package. \n","html","",[42,43,44,53,66,72,78,84,90,96],"code",{"__ignoreMap":40},[45,46,49],"span",{"class":47,"line":48},"line",1,[45,50,52],{"class":51},"sVt8B","at System.Data.Entity.SqlServer.SqlTypesAssemblyLoader.GetSqlTypesAssembly() \n",[45,54,56,59,63],{"class":47,"line":55},2,[45,57,58],{"class":51},"at System.Data.Entity.SqlServer.SqlSpatialDataReader.",[45,60,62],{"class":61},"s7hpK","\u003C",[45,64,65],{"class":51},".cctor>b__0() at System.Lazy`1.CreateValue() \n",[45,67,69],{"class":47,"line":68},3,[45,70,71],{"class":51},"--- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Lazy`1.get_Value()\n",[45,73,75],{"class":47,"line":74},4,[45,76,77],{"class":51},"at System.Data.Entity.SqlServer.SqlSpatialDataReader.GetGeography(Int32 ordinal) at\n",[45,79,81],{"class":47,"line":80},5,[45,82,83],{"class":51},"System.Data.Entity.Core.Common.Internal.Materialization.Shaper.ErrorHandlingValueReader`1.GetValue(DbDataReader reader, Int32 ordinal) at\n",[45,85,87],{"class":47,"line":86},6,[45,88,89],{"class":51},"System.Data.Entity.Core.Common.Internal.Materialization.Shaper.GetSpatialPropertyValueWithErrorHandling[TProperty](Int32 ordinal, String propertyName, String \n",[45,91,93],{"class":47,"line":92},7,[45,94,95],{"class":51},"typeName, PrimitiveTypeKind spatialTypeKind) at lambda_method(Closure , Shaper ) Resolution: To include in your project for deployment purposes, \n",[45,97,99],{"class":47,"line":98},8,[45,100,101],{"class":51},"use nuget to get Microsoft.SqlServer.Types package.\n",[12,103,104],{},[105,106],"img",{"alt":40,"src":107},"\u002Farticles\u002Fimages\u002Fwindows-live-writer-spatial-types-and-functions-are-not-avai_a814-sqlservertypenuget_2.jpg",[12,109,110],{},"After the package is installed, the following readme will give you details for both ASP.NET and Desktop applications.",[12,112,113],{},[105,114],{"alt":40,"src":115},"\u002Farticles\u002Fimages\u002Fwindows-live-writer-spatial-types-and-functions-are-not-avai_a814-actionrequired_2.jpg",[12,117,118],{},"To deploy an application that uses spatial data types to a machine that does not have 'System CLR Types\nfor SQL Server' installed you also need to deploy the native assembly SqlServerSpatial110.dll.Both x86 (32 bit) and x64 (64 bit) versions of this assembly have been added to your project under the SqlServerTypes\\x86 and SqlServerTypes\\x64 subdirectories.",[12,120,121],{},"The native assembly msvcr100.dll is also included  in case the C++runtime is not installed.  Adding the following to the Global.asax.cs Application_Start()",[35,123,127],{"className":124,"code":125,"language":126,"meta":40,"style":40},"language-csharp shiki shiki-themes github-light github-dark","SqlServerTypes.Utilities.LoadNativeAssemblies(Server.MapPath(\"~\u002Fbin\"));\n","csharp",[42,128,129],{"__ignoreMap":40},[45,130,131],{"class":47,"line":48},[45,132,125],{},[134,135,136],"style",{},"html pre.shiki code .sVt8B, html code.shiki .sVt8B{--shiki-default:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .s7hpK, html code.shiki .s7hpK{--shiki-default:#B31D28;--shiki-default-font-style:italic;--shiki-dark:#FDAEB7;--shiki-dark-font-style:italic}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":40,"searchDepth":55,"depth":55,"links":138},[],"2020-06-11T20:28:49.852Z","SQL Server GeoSpatial types","md","\u002Farticles\u002Fimages\u002Fwindows-live-writer-spatial-types-and-functions-are-not-avai_a814-sqlservertypenuget_thumb.jpg",{},true,"\u002Farticles\u002Fmicrosoft-sqlserver-types-getting-it-done",{"title":6,"description":140},"articles\u002Fmicrosoft-sqlserver-types-getting-it-done",[149,150],"mvc","sqlserver","1dmx9etHvwEb9Xf4khJPeF6FdCgWY2eXe5VWYxfvRO4",[153],{"id":154,"title":155,"body":156,"description":160,"extension":141,"img":161,"meta":162,"name":150,"navigation":144,"path":163,"seo":164,"stem":165,"__hash__":166},"tags\u002Ftags\u002Fsqlserver.md","Sqlserver",{"type":9,"value":157,"toc":158},[],{"title":40,"searchDepth":55,"depth":55,"links":159},[],"SQL Server is a relational database management system, or RDBMS, developed and marketed by Microsoft.","https:\u002F\u002Fimages.unsplash.com\u002Fphoto-1598313183973-4effcded8d5e?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=675&q=80",{},"\u002Ftags\u002Fsqlserver",{"description":160},"tags\u002Fsqlserver","pSzcNnE-XyUgq8RlgK2xBpbJV7_7o5NLS2XlwBxFyAg",{"id":168,"title":169,"author":170,"body":171,"createdAt":139,"description":258,"extension":141,"img":195,"meta":259,"navigation":144,"path":261,"seo":262,"stem":263,"tags":264,"updatedAt":139,"__hash__":266},"articles\u002Farticles\u002Fdevops–pushing-nuget-package-to-azure-artifacts-repository.md","DevOps–Pushing Nuget package to Azure Artifacts Repository",null,{"type":9,"value":172,"toc":256},[173,176,179,182,185,188,191,196,199,202,205,223,226,232,238,241,248,253],[12,174,175],{},"What a journey\n",[12,177,178],{},"I am going to document this for the sole reason that I am aware that I will once again need this information\nonly just a few days from now. Problem: I have a nuget package that I want to push to an Azure Artifact directory.",[12,180,181],{},"I figured easy enough there is some documentation, and I tried with the following:",[12,183,184],{},"nuget push -source \"MyFeed_feed\" -apikey az \"C:\\tfs\\Git\\MLayout\\MLayout\\MLayout\\bin\\Debug\\Layout.1.0.0.nupkg\"",[12,186,187],{},"I did have to download Nuget and ensure it was found when using the above command via command prompt. \nOnce setup, and re-ran I was prompted for username and password. As many times as I tried it would just continue to fail and eventually\nwould timeout. I am sure this worked just a few weeks ago.",[12,189,190],{},"Regardless on to plan B, documentation..",[12,192,193],{},[105,194],{"alt":40,"src":195},"\u002Farticles\u002Fimages\u002Fimage_637275041288251465.png",[12,197,198],{},"1) I downloaded the latest Nuget.exe",[12,200,201],{},"2) Download and install the credential provider (this one was a bit more challenging)",[12,203,204],{},"I figured I would use the Automatic approach. ",[12,206,207,208,212,216,217,222],{},"a) I downloaded installcredprovider.ps1 from this github location\n",[209,210],"a",{"href":211},"https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fartifacts-credprovider\u002Ftree\u002Fmaster\u002Fhelpers",[209,213,211],{"href":211,"rel":214},[215],"nofollow","\n(more information can be found ",[209,218,221],{"href":219,"target":220},"https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fartifacts-credprovider#azure-artifacts-credential-provider","_blank","here",")",[12,224,225],{},"b) Now that I have a file on disk, I have to run it. I started Powershell then proceeded to run this\nps1 by typing .\\installcredprovider.ps1 at the PS>",[12,227,228,231],{},[105,229],{"alt":40,"src":230},"\u002Farticles\u002Fimages\u002Fimage_637275041290983297.png","\nd) Now with this installed I retried to push my nuget package with nuget push -source \"MyFeed_feed\" -apikey az \"C:\\tfs\\Git\\MLayout\\MLayout\\MLayout\\bin\\Debug\\Layout.1.0.0.nupkg\"",[12,233,234,237],{},[16,235,236],{},"No go, ","so I tried with using the vs.net command prompt.",[12,239,240],{},"I opened up a command prompt from Windows-Start ensuring to pick the “Developer Command Prompt for VS 2019”",[12,242,243,244,247],{},"Now, I ensured that nuget.exe was available and it was! ",[16,245,246],{},"So I retried my nuget push",". You can see finally, that it used the Credential Provider",[12,249,250],{},[105,251],{"alt":40,"src":252},"\u002Farticles\u002Fimages\u002Fimage_637275041296161377.png",[12,254,255],{},"The entire process probably 1 hour of effort, but essentially using the VS.NET 2019 command prompt, download the ps1 for the credprovider,\nexecute using powershell then retry.",{"title":40,"searchDepth":55,"depth":55,"links":257},[],"Some days you can be really productive, and others some very simple things just seem to eat up time.  Today, I came across the latter and thought I would document for others and also myself.  Installing a credprovider in order to push a nuget package to Auzre-DevOps.  Read on...",{"name":260},"David","\u002Farticles\u002Fdevops-pushing-nuget-package-to-azure-artifacts-repository",{"title":169,"description":258},"articles\u002Fdevops–pushing-nuget-package-to-azure-artifacts-repository",[265],"azure","Zw3qsYjIGVLIj9PIXvZHt_pkg1PaGxS6xuD33wiVVHg",{"id":268,"title":269,"author":7,"body":270,"createdAt":139,"description":170,"extension":141,"img":519,"meta":520,"navigation":144,"path":521,"seo":522,"stem":523,"tags":524,"updatedAt":139,"__hash__":528},"articles\u002Farticles\u002Fstarting-jquery-and-get-the-downloads-and-patchesfor-visual-studio-net-2008.md","Starting jQuery and Get the downloads and patches(for Visual Studio.NET 2008)",{"type":9,"value":271,"toc":517},[272,283,291,514],[12,273,274,275,278,279,282],{},"1.) Download install VS.NET 2008 SP1 patch   Visual Studio 2008 SP1 has the following patch to allow IntelliSense with jQuery found\n",[209,276,221],{"href":277,"target":220},"http:\u002F\u002Fcode.msdn.microsoft.com\u002FKB958502\u002FRelease\u002FProjectReleases.aspx?ReleaseId=1736",".  Note: this is a patch that is applied\nafter .NET 3.5 SP1 and Visual Studio 2008 SP1.  Information about this patch can be found\n",[209,280,221],{"href":281,"target":220},"http:\u002F\u002Fblogs.msdn.com\u002Fwebdevtools\u002Farchive\u002F2008\u002F11\u002F07\u002Fhotfix-to-enable-vsdoc-js-intellisense-doc-files-is-now-available.aspx",".\nI did find that the vsdoc.js version must match the version of jquery in order for the intellisense to function correctly.  If the versions mismatch intellisense\nwill not work.",[12,284,285,286,290],{},"2.) ",[209,287,289],{"href":288,"target":220},"http:\u002F\u002Fdocs.jquery.com\u002FDownloading_jQuery","Download"," jQuery documentation library  ",[292,293,294,303,309,312,440,445,508,511],"blockquote",{},[12,295,296,297,299,300],{},"3.) ",[209,298,289],{"href":288,"target":220}," jQuery \n",[105,301],{"alt":40,"src":302},"\u002Farticles\u002Fimages\u002FAsp.netCompilationModels_86E6\u002Fimage_4a.png",[12,304,305,306],{},"4.) Copy both 2 and 3 to your solution Scripts folder\n",[105,307],{"alt":40,"src":308},"\u002Farticles\u002Fimages\u002FAsp.netCompilationModels_86E6\u002Fimage_8.png",[12,310,311],{},"5.) In your aspx reference the jquery file",[35,313,317],{"className":314,"code":315,"language":316,"meta":40,"style":40},"language-js shiki shiki-themes github-light github-dark","\u003Cscript src=\"Scripts\u002Fjquery-1.2.6.min.js\" type=\"text\u002Fjavascript\">\u003C\u002Fscript>    or    \u003Casp:ScriptManager runat=\"server\" ID=\"scriptmanager1\">     \n    \u003CScripts>      \n        \u003Casp:ScriptReference Path=\"~\u002FScripts\u002Fjquery-1.2.6.min\" \u002F>      \n    \u003C\u002FScripts>      \n\u003C\u002Fasp:ScriptManager> \n","js",[42,318,319,383,394,418,427],{"__ignoreMap":40},[45,320,321,323,327,331,335,339,342,344,347,350,352,355,357,360,363,365,368,372,374,377,380],{"class":47,"line":48},[45,322,62],{"class":51},[45,324,326],{"class":325},"s9eBZ","script",[45,328,330],{"class":329},"sScJk"," src",[45,332,334],{"class":333},"szBVR","=",[45,336,338],{"class":337},"sZZnC","\"Scripts\u002Fjquery-1.2.6.min.js\"",[45,340,341],{"class":329}," type",[45,343,334],{"class":333},[45,345,346],{"class":337},"\"text\u002Fjavascript\"",[45,348,349],{"class":51},">\u003C\u002F",[45,351,326],{"class":325},[45,353,354],{"class":51},">    or    ",[45,356,62],{"class":333},[45,358,359],{"class":329},"asp",[45,361,362],{"class":51},":ScriptManager runat",[45,364,334],{"class":333},[45,366,367],{"class":337},"\"server\"",[45,369,371],{"class":370},"sj4cs"," ID",[45,373,334],{"class":333},[45,375,376],{"class":337},"\"scriptmanager1\"",[45,378,379],{"class":333},">",[45,381,382],{"class":51},"     \n",[45,384,385,388,391],{"class":47,"line":55},[45,386,387],{"class":51},"    \u003C",[45,389,390],{"class":370},"Scripts",[45,392,393],{"class":51},">      \n",[45,395,396,399,401,404,407,410,412,415],{"class":47,"line":68},[45,397,398],{"class":51},"        \u003C",[45,400,359],{"class":325},[45,402,403],{"class":51},":",[45,405,406],{"class":370},"ScriptReference",[45,408,409],{"class":329}," Path",[45,411,334],{"class":333},[45,413,414],{"class":337},"\"~\u002FScripts\u002Fjquery-1.2.6.min\"",[45,416,417],{"class":51}," \u002F>      \n",[45,419,420,423,425],{"class":47,"line":74},[45,421,422],{"class":51},"    \u003C\u002F",[45,424,390],{"class":370},[45,426,393],{"class":51},[45,428,429,432,434,437],{"class":47,"line":80},[45,430,431],{"class":333},"\u003C\u002F",[45,433,359],{"class":329},[45,435,436],{"class":51},":ScriptManager",[45,438,439],{"class":333},">\n",[12,441,442],{},[16,443,444],{},"Some Quick Tips",[446,447,448,452,464,470,483,489,495],"ul",{},[449,450,451],"li",{},"If you are using a master page the script reference only needs to exist in the master page",[449,453,454,455,457,458,460,461,463],{},"javascript intellisense will not work in user controls by default as\nthe user control doesn’t have a reference to the js file.  A work around (use the following at the top of the user control).  At runtime ASP.NET will\nnot render this tag however Visual Studio will evaluate the script and provide intellisense",[24,456],{},"\n\u003C% if (false) { %>",[24,459],{},"\n      \u003Cscript src=”..\u002FScripts\u002Fjquery-1.2.6.min.js” type=”text\u002Fjavascript”>",[24,462],{},"\n\u003C% } %>",[449,465,466,467,469],{},"a recommended method of including js files is to create one js file which entail will include references to any number of specific js files, then on your web page\ninclude a reference to this one single js file",[24,468],{},"\n\u003Creference path=”~\u002FScripts\u002Fjquery-1.2.6.min.js” \u002F>",[449,471,472,473,475,478,479,482],{},"a good approach is to remove the version number from the jquery files to allow easier updates to these files in the future",[24,474],{},[16,476,477],{},"Path(s) for Script References","     * ",[16,480,481],{},"File-Relative Paths"," i.e. ..\u002F..\u002Ffile.js This type of path\nis relative to the currently loaded file.  Support - ASP.NET Web forms \u002F MVC",[449,484,485,488],{},[16,486,487],{},"App-Relative Paths"," i.e. ~\u002Ffolder\u002Ffile.js  Is calculated\nfrom the base of your application.  ASP.NET Web forms supports this type of path however\nthe path must be within a scriptreference tag or select asp.net\ncontrols which have runat=”server”",[449,490,491,494],{},[16,492,493],{},"Site-Relative Paths"," i.e. \u002Ffolder\u002Ffile.js  Is calculated from the base of your site.  Supported\nby ASP.NET Web forms \u002F MVC however is not supported by Visual Studio",[449,496,497,500,501,504,507],{},[16,498,499],{},"Absolute Paths"," i.e. ",[209,502],{"href":503},"http:\u002F\u002Fsite\u002Ffolder\u002Ffile.js",[209,505,503],{"href":503,"rel":506},[215]," \nSupported by ASP.NET Web forms \u002F MVC and Visual Studio   If using Visual Studio(ASP.NET Web forms) recommended to use App-Relative paths ~\u002Ffolder\u002Ffile.js. ",[12,509,510],{},"If using MVC use file-relative paths.",[105,512],{"src":513,"alt":40},"\u002Farticles\u002Fimages\u002Fjquery.jpg",[134,515,516],{},"html pre.shiki code .sVt8B, html code.shiki .sVt8B{--shiki-default:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .s9eBZ, html code.shiki .s9eBZ{--shiki-default:#22863A;--shiki-dark:#85E89D}html pre.shiki code .sScJk, html code.shiki .sScJk{--shiki-default:#6F42C1;--shiki-dark:#B392F0}html pre.shiki code .szBVR, html code.shiki .szBVR{--shiki-default:#D73A49;--shiki-dark:#F97583}html pre.shiki code .sZZnC, html code.shiki .sZZnC{--shiki-default:#032F62;--shiki-dark:#9ECBFF}html pre.shiki code .sj4cs, html code.shiki .sj4cs{--shiki-default:#005CC5;--shiki-dark:#79B8FF}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":40,"searchDepth":55,"depth":55,"links":518},[],"\u002Farticles\u002Fimages\u002Fimage_thumb.png",{},"\u002Farticles\u002Fstarting-jquery-and-get-the-downloads-and-patchesfor-visual-studio-net-2008",{"title":269,"description":170},"articles\u002Fstarting-jquery-and-get-the-downloads-and-patchesfor-visual-studio-net-2008",[525,526,527],"aspnet","javascript","visualstudio","CaoqzxSPqdjjJIKDlApGzP7mizluXjytJfH68p7chaE",1781574767943]