[{"data":1,"prerenderedAt":438},["ShallowReactive",2],{"article-devops-pushing-nuget-package-to-azure-artifacts-repository":3},{"article":4,"tags":113,"previous":128,"next":301},{"id":5,"title":6,"author":7,"body":8,"createdAt":101,"description":102,"extension":103,"img":36,"meta":104,"navigation":106,"path":107,"seo":108,"stem":109,"tags":110,"updatedAt":101,"__hash__":112},"articles\u002Farticles\u002Fdevops–pushing-nuget-package-to-azure-artifacts-repository.md","DevOps–Pushing Nuget package to Azure Artifacts Repository",null,{"type":9,"value":10,"toc":98},"minimark",[11,15,18,21,24,27,30,37,40,43,46,64,67,73,80,83,90,95],[12,13,14],"p",{},"What a journey\n",[12,16,17],{},"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,19,20],{},"I figured easy enough there is some documentation, and I tried with the following:",[12,22,23],{},"nuget push -source \"MyFeed_feed\" -apikey az \"C:\\tfs\\Git\\MLayout\\MLayout\\MLayout\\bin\\Debug\\Layout.1.0.0.nupkg\"",[12,25,26],{},"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,28,29],{},"Regardless on to plan B, documentation..",[12,31,32],{},[33,34],"img",{"alt":35,"src":36},"","\u002Farticles\u002Fimages\u002Fimage_637275041288251465.png",[12,38,39],{},"1) I downloaded the latest Nuget.exe",[12,41,42],{},"2) Download and install the credential provider (this one was a bit more challenging)",[12,44,45],{},"I figured I would use the Automatic approach. ",[12,47,48,49,53,57,58,63],{},"a) I downloaded installcredprovider.ps1 from this github location\n",[50,51],"a",{"href":52},"https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fartifacts-credprovider\u002Ftree\u002Fmaster\u002Fhelpers",[50,54,52],{"href":52,"rel":55},[56],"nofollow","\n(more information can be found ",[50,59,62],{"href":60,"target":61},"https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fartifacts-credprovider#azure-artifacts-credential-provider","_blank","here",")",[12,65,66],{},"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,68,69,72],{},[33,70],{"alt":35,"src":71},"\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,74,75,79],{},[76,77,78],"strong",{},"No go, ","so I tried with using the vs.net command prompt.",[12,81,82],{},"I opened up a command prompt from Windows-Start ensuring to pick the “Developer Command Prompt for VS 2019”",[12,84,85,86,89],{},"Now, I ensured that nuget.exe was available and it was! ",[76,87,88],{},"So I retried my nuget push",". You can see finally, that it used the Credential Provider",[12,91,92],{},[33,93],{"alt":35,"src":94},"\u002Farticles\u002Fimages\u002Fimage_637275041296161377.png",[12,96,97],{},"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":35,"searchDepth":99,"depth":99,"links":100},2,[],"2020-06-11T20:28:49.852Z","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...","md",{"name":105},"David",true,"\u002Farticles\u002Fdevops-pushing-nuget-package-to-azure-artifacts-repository",{"title":6,"description":102},"articles\u002Fdevops–pushing-nuget-package-to-azure-artifacts-repository",[111],"azure","Zw3qsYjIGVLIj9PIXvZHt_pkg1PaGxS6xuD33wiVVHg",[114],{"id":115,"title":116,"body":117,"description":121,"extension":103,"img":122,"meta":123,"name":111,"navigation":106,"path":124,"seo":125,"stem":126,"__hash__":127},"tags\u002Ftags\u002Fazure.md","Azure",{"type":9,"value":118,"toc":119},[],{"title":35,"searchDepth":99,"depth":99,"links":120},[],"Azure cloud platform is more than 200 products and cloud services designed to help you bring new solutions to life","https:\u002F\u002Fimages.unsplash.com\u002Fphoto-1598313183973-4effcded8d5e?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=675&q=80",{},"\u002Ftags\u002Fazure",{"description":121},"tags\u002Fazure","m01ax_ShM5MuWl7UByoMyql_zrDRu_4udP4MyD4fL-k",{"id":129,"title":130,"author":131,"body":132,"createdAt":101,"description":293,"extension":103,"img":145,"meta":294,"navigation":106,"path":295,"seo":296,"stem":297,"tags":298,"updatedAt":101,"__hash__":300},"articles\u002Farticles\u002Fasp-net-mvc-versions-microsoft-aspnet-mvc.md","ASP.NET MVC Versions of Microsoft.AspNet.Mvc","[object Object]",{"type":9,"value":133,"toc":291},[134,137,149,156,166,185,187,215,225],[12,135,136],{},"While creating a new web application targeting .NET Framework 4 we see a dialog like the following.  Great all good right. ",[12,138,139],{},[50,140,142],{"href":141},"\u002Farticles\u002Fimages\u002Fwindows-live-writer-fa2dee033792_a6f6-image_2.png",[33,143],{"style":144,"src":145,"alt":146,"title":146,"width":147,"height":148},"display: inline;","\u002Farticles\u002Fimages\u002Fwindows-live-writer-fa2dee033792_a6f6-image_thumb.png","image",306,83,[12,150,151,152,155],{},"What is Microsoft.AspNet.Mvc? What is System.Web.Mvc.dll?  Are these related…in short yes.  I had some confusion as to the relationship between System.Web.Mvc and the Nuget package Microsoft.AspNet.Mvc.  Here is how….",[153,154],"br",{},"\nYes, they are very much related.  Do things have to be this confusing? ",[12,157,158,159],{},"So tracking this down, I created a new out-of-the-box Asp.Net MVC Application.  Afterwards, I opened up Nuget Manager in order to review what packages were installed.  I see a number of packages needing updating.  In particular, I see one Microsoft.AspNet.Mvc however I do not see this assembly in my project references.  Remember - Nuget packages can and do include one or more assemblies(dll’s) and can be named differently than the package name.  In this particular case, the package Microsoft.AspNet.Mvc contains the System.Web.Mvc.dll.  For the record, the project when created referenced this package..",[160,161,165],"package",{"id":162,"version":163,"targetframework":164},"Microsoft.AspNet.Mvc","4.0.30506.0","net40","  (this package includes the System.Web.Mvc.dll Runtime Version v4.0.30319, Version 4.0.0.0 and specifically Product version 4.0.20710.0 shown via file properties)",[12,167,168,169,171,181,182],{},"Inside the out of box .NET 4, MVC application we have…",[153,170],{},[50,172,174],{"href":173},"\u002Farticles\u002Fimages\u002Fwindows-live-writer-fa2dee033792_a6f6-image_6.png",[33,175],{"style":176,"src":177,"border":178,"alt":146,"title":146,"width":179,"height":180},"background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-width: 0px;","\u002Farticles\u002Fimages\u002Fwindows-live-writer-fa2dee033792_a6f6-image_thumb_2.png",0,260,285,"  ",[50,183],{"href":184},"\u002Farticles\u002Fimages\u002Fwindows-live-writer-fa2dee033792_a6f6-image_4.png",[50,186],{"href":184},[12,188,189,196,197,199,200],{},[50,190,191],{"href":184},[33,192],{"style":176,"src":193,"border":178,"alt":146,"title":146,"width":194,"height":195},"\u002Farticles\u002Fimages\u002Fwindows-live-writer-fa2dee033792_a6f6-image_thumb_1.png",308,289," ",[153,198],{},"\nLooking at the System.Web.Mvc.dll that was delivered with the new .NET 4 application we have the following dll.  In addition, if we look at the existing Nuget packages in the application we have the following package ",[160,201,202,204,212,214],{"id":162,"version":163,"targetframework":164},[153,203],{},[50,205,207],{"href":206},"\u002Farticles\u002Fimages\u002Fwindows-live-writer-fa2dee033792_a6f6-image_8.png",[33,208],{"style":176,"src":209,"border":178,"alt":146,"title":146,"width":210,"height":211},"\u002Farticles\u002Fimages\u002Fwindows-live-writer-fa2dee033792_a6f6-image_thumb_3.png",346,264,[153,213],{},"\nNow, we will update the Microsoft.AspNet.Mvc version 4.0.30506.0 package to 4.0.40804.0 to see what occurs.",[12,216,217],{},[50,218,220],{"href":219},"\u002Farticles\u002Fimages\u002Fwindows-live-writer-fa2dee033792_a6f6-image_10.png",[33,221],{"style":176,"src":222,"border":178,"alt":146,"title":146,"width":223,"height":224},"\u002Farticles\u002Fimages\u002Fwindows-live-writer-fa2dee033792_a6f6-image_thumb_4.png",134,240,[12,226,227,228],{},"The package in the packages file was updated to ",[160,229,231,232,181,240,248,250,253,255,258,260,261],{"id":162,"version":230,"targetframework":164},"4.0.40804.0","  Looking at the project references after the update we can see System.Web.Mvc Runtime version 4.0.30319 and Version 4.0.0.1.  Note: the file in the bin directory is not updated until after a project build.  Now looking at the file properties we can see File version 4.0.40804.0 and Product version 4.040804.0\n",[50,233,235],{"href":234},"\u002Farticles\u002Fimages\u002Fwindows-live-writer-fa2dee033792_a6f6-image_12.png",[33,236],{"style":176,"src":237,"border":178,"alt":146,"title":146,"width":238,"height":239},"\u002Farticles\u002Fimages\u002Fwindows-live-writer-fa2dee033792_a6f6-image_thumb_5.png",138,226,[50,241,243],{"href":242},"\u002Farticles\u002Fimages\u002Fwindows-live-writer-fa2dee033792_a6f6-image_16.png",[33,244],{"style":176,"src":245,"border":178,"alt":146,"title":146,"width":246,"height":247},"\u002Farticles\u002Fimageswindows-live-writer-fa2dee033792_a6f6-image_thumb_7.png",201,244,[153,249],{},[76,251,252],{},"In summary…",[153,254],{},[76,256,257],{},"Before",[153,259],{},"\nNuget Package: ",[160,262,263,264,266,269,260,271],{"id":162,"version":163,"targetframework":164},"\nProject Reference: System.Web.Mvc.dll Runtime Version v4.0.30319, Version 4.0.0.0\nFile System: Product version 4.0.20710.0",[153,265],{},[76,267,268],{},"After",[153,270],{},[160,272,273,274,276,277],{"id":162,"version":230,"targetframework":164},"\nProject Reference:System.Web.Mvc Runtime version 4.0.30319 and Version 4.0.0.1\nFile System:File version 4.0.40804.0",[153,275],{},"\nWe also have to note that the web.config was updated by the Nuget package, notice below the newVersion is 4.0.0.1\n",[278,279,280,281],"dependent-assembly",{},"\n  ",[282,283,280,286],"assembly-identity",{"name":284,"publickeytoken":285},"System.Web.Mvc","31bf3856ad364e35",[287,288],"binding-redirect",{"oldversion":289,"newversion":290},"0.0.0.0-4.0.0.1","4.0.0.1",{"title":35,"searchDepth":99,"depth":99,"links":292},[],"Versions of Asp.net",{},"\u002Farticles\u002Fasp-net-mvc-versions-microsoft-aspnet-mvc",{"title":130,"description":293},"articles\u002Fasp-net-mvc-versions-microsoft-aspnet-mvc",[299],"visualstudio","j2JjzZkhslYYQHf8dsNiFM_V-AhPEaLg23n12z9xFLw",{"id":302,"title":303,"author":131,"body":304,"createdAt":101,"description":428,"extension":103,"img":429,"meta":430,"navigation":106,"path":431,"seo":432,"stem":433,"tags":434,"updatedAt":101,"__hash__":437},"articles\u002Farticles\u002Fmicrosoft-sqlserver-types-getting-it-done.md","Microsoft.SqlServer.Types–Getting it done.",{"type":9,"value":305,"toc":426},[306,313,326,392,397,400,405,408,411,422],[12,307,308,309,312],{},"Recently, started working with SQL Server GeoSpatial types. Specifically I am using column type ",[76,310,311],{},"geography. ","\nAll was working fine when using on localhost web site however after deployment to a test environment, I go the following exception.",[12,314,315,316,318,319,322,325],{},"Initially, I thought something was not installed on the server (could still be) however the following is the exception and the resolution. Exception:",[153,317],{},"\nSystem.InvalidOperationException: Spatial types and functions are not available for this provider because the assembly ",[76,320,321],{},"'Microsoft.SqlServer.Types'",[76,323,324],{},"version 10 or higher could not be found",".",[327,328,332],"pre",{"className":329,"code":330,"language":331,"meta":35,"style":35},"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",[333,334,335,344,356,362,368,374,380,386],"code",{"__ignoreMap":35},[336,337,340],"span",{"class":338,"line":339},"line",1,[336,341,343],{"class":342},"sVt8B","at System.Data.Entity.SqlServer.SqlTypesAssemblyLoader.GetSqlTypesAssembly() \n",[336,345,346,349,353],{"class":338,"line":99},[336,347,348],{"class":342},"at System.Data.Entity.SqlServer.SqlSpatialDataReader.",[336,350,352],{"class":351},"s7hpK","\u003C",[336,354,355],{"class":342},".cctor>b__0() at System.Lazy`1.CreateValue() \n",[336,357,359],{"class":338,"line":358},3,[336,360,361],{"class":342},"--- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Lazy`1.get_Value()\n",[336,363,365],{"class":338,"line":364},4,[336,366,367],{"class":342},"at System.Data.Entity.SqlServer.SqlSpatialDataReader.GetGeography(Int32 ordinal) at\n",[336,369,371],{"class":338,"line":370},5,[336,372,373],{"class":342},"System.Data.Entity.Core.Common.Internal.Materialization.Shaper.ErrorHandlingValueReader`1.GetValue(DbDataReader reader, Int32 ordinal) at\n",[336,375,377],{"class":338,"line":376},6,[336,378,379],{"class":342},"System.Data.Entity.Core.Common.Internal.Materialization.Shaper.GetSpatialPropertyValueWithErrorHandling[TProperty](Int32 ordinal, String propertyName, String \n",[336,381,383],{"class":338,"line":382},7,[336,384,385],{"class":342},"typeName, PrimitiveTypeKind spatialTypeKind) at lambda_method(Closure , Shaper ) Resolution: To include in your project for deployment purposes, \n",[336,387,389],{"class":338,"line":388},8,[336,390,391],{"class":342},"use nuget to get Microsoft.SqlServer.Types package.\n",[12,393,394],{},[33,395],{"alt":35,"src":396},"\u002Farticles\u002Fimages\u002Fwindows-live-writer-spatial-types-and-functions-are-not-avai_a814-sqlservertypenuget_2.jpg",[12,398,399],{},"After the package is installed, the following readme will give you details for both ASP.NET and Desktop applications.",[12,401,402],{},[33,403],{"alt":35,"src":404},"\u002Farticles\u002Fimages\u002Fwindows-live-writer-spatial-types-and-functions-are-not-avai_a814-actionrequired_2.jpg",[12,406,407],{},"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,409,410],{},"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()",[327,412,416],{"className":413,"code":414,"language":415,"meta":35,"style":35},"language-csharp shiki shiki-themes github-light github-dark","SqlServerTypes.Utilities.LoadNativeAssemblies(Server.MapPath(\"~\u002Fbin\"));\n","csharp",[333,417,418],{"__ignoreMap":35},[336,419,420],{"class":338,"line":339},[336,421,414],{},[423,424,425],"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":35,"searchDepth":99,"depth":99,"links":427},[],"SQL Server GeoSpatial types","\u002Farticles\u002Fimages\u002Fwindows-live-writer-spatial-types-and-functions-are-not-avai_a814-sqlservertypenuget_thumb.jpg",{},"\u002Farticles\u002Fmicrosoft-sqlserver-types-getting-it-done",{"title":303,"description":428},"articles\u002Fmicrosoft-sqlserver-types-getting-it-done",[435,436],"mvc","sqlserver","1dmx9etHvwEb9Xf4khJPeF6FdCgWY2eXe5VWYxfvRO4",1781574762987]