microsoft / sqltoolsservice

SQL Tools API service that provides SQL Server data management capabilities.
Other
438 stars 153 forks source link

Build errors accessing mssqltools nuget feed #1173

Open kburtram opened 3 years ago

kburtram commented 3 years ago

Build is failing with the below permissions issue on my dev box. We shouldn't have references to Nuget feedbacks not publicly accessible.

C:\Program Files\dotnet\sdk\3.1.406\NuGet.targets(128,5): error : Unable to load the service index for source https://mssqltools.pkgs.visualstudio.com/_packaging/mssqltools/nuget/v3/index.json. [D:\xplat\sqltoolsservice\sqltoolsservice.sln]
C:\Program Files\dotnet\sdk\3.1.406\NuGet.targets(128,5): error :   Response status code does not indicate success: 401 (Unauthorized). [D:\xplat\sqltoolsservice\sqltoolsservice.sln]
kburtram commented 3 years ago

When I remove the line for the tools feed I get a bunch of errors for ScriptDOM version (pasted below).

@Charles-Gagnon it looks like you touched this file most recently. Do you have context on what I would need to do to avoid this error? Or should I investigate further?

D:\xplat\sqltoolsservice\src\Microsoft.SqlTools.ServiceLayer\Microsoft.SqlTools.ServiceLayer.csproj : warning NU1603: MicrosoftSqlToolsServiceLayer depends on Microsoft.SqlServer.TransactSql.ScriptDom.Nrt (>= 1.2.10202.1) but Microsoft.SqlServer.TransactSql.ScriptDom.Nrt 1.2.10202.1 was not found. An approximate best match of Microsoft.SqlServer.TransactSql.ScriptDom.Nrt 1.2.65626.134 was resolved. [D:\xplat\sqltoolsservice\sqltoolsservice.sln]
Charles-Gagnon commented 3 years ago

@Benjin Karl brings up a good point - we shouldn't be using internal feeds like this for an open source project. What's the possibility of getting the NRT version of ScriptDom on nuget.org or something?

@kburtram While we work on a solution for this the temporary solution is to create a PAT for the mssqltools repo and then add it to the Nuget.config as documented here : https://docs.microsoft.com/en-us/nuget/reference/nuget-config-file#packagesourcecredentials

Benjin commented 3 years ago

Lemme spin up a thread to ask.

kburtram commented 3 years ago

In the past when we've needed to reference preview nuget packages we've checked them directly into the repo and pointed the nuget.config at the folder. If there isn't a better way, such as what @Charles-Gagnon suggested above, we should likely go that route. But yeah, the OSS repos need to be buildable externally without requiring access to internal systems.

...to unblock myself I just removed this feed from the nuget config and this auto-downgraded the package to the latest publicly available.