I cannot connect to azure devops artifacts - nuget feed - visual-studio-2017

I cannot connect to my nuget feed by visual studio 2017 enterprise. I'm owner of nuget feed. When I use browser in VS i can connect but when i use nuget source i get 401 unauthorized exception.
enter image description here

Does your organization connect to AAD? Do you use a Work account or Microsoft account?
If your organization doesn’t connect to AAD, and you use a work account, you’ll meet this error. If you use a MSA account, you’ll find you can restore the packages without issue.
It’s a known issue, and has been fixed in VS 2019 Preview2 (I have verified it’s working in VS2019 Preview2). Currently, the workaround for previous versions of VS is generating a PAT and register the Nuget feed on your system with following command. I’ve tested in VS2017, after running the command below, I can restore the package with a work account:
nuget.exe sources Add -Name "FeedName" -Source "https://feedurl" -username unused -password PAT

Related

Error trying to install latest nuget pkg Aspose.Cells

Trying to install the latest Aspose.Cells package in VS 2019. Had a buddy try the same thing, same error. Have a license. What am I missing?
Severity Code Description Project File Line Suppression State
Error The feed 'nuget.org [https://api.nuget.org/v3/index.json]' lists package 'Aspose.Cells.22.3.0' but multiple attempts to download the nupkg have failed. The feed is either invalid or required packages were removed while the current operation was in progress. Verify the package exists on the feed and try again.
Unable to find package 'Aspose.Cells.22.3.0'.
I tested your scenario/case. I created a new console application in VS.NET 2019. Then, I clicked on Tools|Nuget Package Manager|Manage Nuget Packages… option. Now I searched Aspose.Cells (v22.3.0) after clicking Browse link. I then installed the latest version and it works fine. I do not get any error during the import process as well.
The issue might be due to NuGet Package Manager configuration on your end. You may clear NuGet cache and give it a try in your VS.NET again.
PS. I am working as Support developer/ Evangelist at Aspose.

Visual Studio - Error: Unable to download installation files

I'm following a nice tutorial on hosting Django on Apache, for that I need to install mod_wsgi using pip. This needs c++ 14.0 or higher .. I've been trying to install visual studio community edition and it's tools using the microsoft installer. However, a bugging error keeps chacing me:
"Unable to download installation files. Check your internet connection and try again"
Now my internet connection is fine, I also did many attempts to restart, and re-download - cmd commands for offline installation and many many attempts.
I need help here as It is driving me crazy!:D can anybody please help?
all the best
Visual Studio - Error: Unable to download installation files
You can try these steps:
First, make sure that you use administrator account to log on to the PC and your Internet can access any websites.
1) delete the Installer folder under C:\Program Files (x86)\Microsoft Visual Studio\
2) Right-click on the vs_xxxxx_xxxx.exe(installer program)-->Properties-->Digital Signatures-->you can see "signature list"-->Select signature and then Click on Details button-->Click on View certificate button--> Click on Install certificate and follows installation wizard.
3) Fire up Run, type gpedit.msc
Brows to the following location: Computer Configuration-->Administrative Templates-->System-->Internet Communication Management-->Internet Communication settings then find the entry Turn off Automatic Root Certificates Update and open her up and set it to Disabled.
4) Get Windows to check for updates and if so, update it.
5) Then run the installer as administrator to install it.
In addition, if you create an offline installation, please use like this:(remember to add --lang en-us)
vs_community.exe --layout C:\vs2019offline --lang en-us
Besides, when you finish it, please install the three certificates as administrator which are in the certificates folder of the offline package and after that, install the installer.
Also, make sure that these certificates are in the trusted folder.

Package restore failed. Rolling back package changes for 'ConsoleApp1' while installing new package

I get Package restore failed. Rolling back package changes for 'ConsoleApp1' while installing a new package. In particular I am trying to install the dropbox API, but I tried several other packages and get the same result.
I install by right clicking on the project and choosing Manage nuGet Packages... Then I select the package and click Install.
The NuGet is able to connect with the NuGet server as the package seems to download. The download information flashes on the screen pretty quick so I captured it with screen recording software to see if there were error messages. There were none.
I updated visual studio 2017 to latest patch level. My windows 10 machine is also at the latest level.
The project I am trying to install into is a freshly created Console App(.Net Core).
Here are the other questions I looked at:
Package restore failed. Rolling back package changes
does not have any responses because it is not a well developed question.
package restore failed rolling back package change for ' myproject' in vs 2017 .net mvc core project
Yet another poorly worded question with no viable answers.
Package restore failed. Rolling back package changes for 'myproject' in vs 2017 in MVC Core
That one is trying to update packages, not install new.
Nuget - Package restore failed. Rolling back package changes for 'WebApplication1'. 0
Seems to be for a custom package.
I am new to using Visual Studio.
To expand on #Michael Potter's answer, create a Console App (.NET Framework), NOT Console App (.NET Core).
The problem was that I am using Console App(.Net Core) Core is not compatible with Dropbox API.
I figured that out by opening NuGet Package Manager -> Package Manager Console and running Install-Package Dropbox-Api.
Then the error message about compatibility was on the screen plain to see.
To solve the problem I am switching to Console App (.Net Framework).
bring the version of the solution package to 1.1.3enter image description here

Build Failing - Missing Visual studio 2017 data tool

I am getting below error while building my project. It seems I am missing data tool components on my build agent
No agent found in pool Hosted VS2017 which satisfies the specified
demands: sqlpackage Agent.Version -gtVersion 1.103.0
But I am unable to get offline installer for data tools for VS 2017. Please help.
The sqlpackage.exe is existing on Hosted VS 2017 agent, but not in the capacity list. (can’t add this capacity manually and use deploy database task, check VS2017 Hosted Agent: SQL Server Data Tools)
The workaround is that you can call sqlpackage.exe command by using Command Line task:
Right click your project > Publish to create a publish profile
Edit that publish profile to add Password to TargetConnectionString (Could be tokenized by using Replace Tokens task)
Sample:
<TargetConnectionString>Data Source=XXX.database.windows.net,1433;Persist Security Info=True;User ID=XXX;Password=XXX;Pooling=False;MultipleActiveResultSets=False;Connect Timeout=60;Encrypt=False;TrustServerCertificate=True</TargetConnectionString>
Check in changes
Add Command line task: (Tool: C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\Extensions\Microsoft\SQLDB\DAC\130\sqlpackage.exe; Arguments: /Action:Publish /SourceFile:"$(build.artifactstagingdirectory)\DatabaseDemo.dacpac" /Profile:"$(build.sourcesdirectory)\DatabaseDemo\DatabaseDemo.publish.xml")
Queue build with Hosted VS2017 agent.

Configure local build server to work with a Visual Studio Online account

Is it possible to use a local build server for a Visual Studio Online account so that with a gated check-in policy, check-ins are only committed when the build server builds successfully? I don't have expertise in this space, so ideally I'm looking for steps to do the setup.
Yes, you can do what you are asking. Simply install TFS Build Server and when you are configuring it give it the URL for your VSO Collection.