nuget credentials how to tell which provider is being used? - tfs

So for "security" reasons I am forced to use a different account to run visual studio for certain admin level operations (registering COM objects mostly). TFS however only knows about my lower level regular account. In the past this hasn't been an issue and I've set credentials up for my admin account to log into TFS with the regular account.
However something has changed since I last did a password change and logging into one particular nuget feed (hosted by TFS / Azure devops server in house) from VS2019 running as admin will lock my AD account. Also my git TFS account seems not to be using the correct account. A different feed hosted by the same TFS instance (the only difference is the feed name) works fine.
I have tried setting credentials for nuget using dotnet nuget update source name -u username -p password and that hasn't helped. I suspect since git gives issues when I push to the TFS server it's using some sort of windows stored user name and password and nuget is using the same invalid credentials. I can login to TFS to search for work items in VS2019 to add on git commits so at least one provider is set correctly.
So my question is how do I find out what the actual username and credential type / provider is being used for a particular nuget feed? Ideally I'd like to find out what username it's using as well.

Please first make sure the account you were logging in with do have permission to the nuget package.
how do I find out what the actual username and credential type / provider is being used for a particular nuget feed?
You should find CredentialProvider in my local folder:
C:\Users\[username]\AppData\Local\NuGet\CredentialProviders\
Use NuGet with Azure DevOps Services feeds
Also give a try with below solution, check if this do the trick:
Right click on your solution from Solution Explorer
Manage Nuget Packages for Solution-> on top right corner click on the gear symbol -> on the left hand-side go to NuGet Package Manager
Package Sources -> on right hand-side UNCHECKED the package source you are having trouble with
Click Ok button -> restart your VS it should only ask you login once
now
.

Okay in my case it turns out different versions of nuget are in use.
The CredentialProviders folder was empty.
However I suspect an older version of nuget was involved that looks in this config file
C:\Users\<your_account>\AppData\Roaming\NuGet\NuGet.Config which in my case had the same repository name twice with slightly different casing (no idea why?) and the password was incorrect on one of those entries (they should all be the same).
So running nuget.exe sources update for the older mechanism as well as dotnet nuget update source worked. I also notice that update source requires a later version of the dotnet sdk than I happened to have specified in global.json for this project.
So I suspect this is mostly down to having
multiple versions of nuget on my machine along with a somewhat elderly dotnet sdk being in use.
The nuget repository having the same name only differing in case
I hope this helps someone else at some point.
I have marked Patrick Lu answer as correct as it actually answers my original question.

Related

How to get changes from other users in VS Code from TFS

This question is for building Angular application in VS Code.
My team has been coding in VS2015 and using Microsoft TFS for version control (Please note that our code is within the company firewall, on a local TFS build server and not on Gits repository). For Angular, I installed VS Code and Azure Repos plugin for TFS.
Once Work-space is setup, I can see the files (I downloaded the files from VS2015 on local machine) but they all show as "Untracked" changes - why? These are checked in files.
Also, when a colleague checks-in files from their VS Code instance, my VS Code doesn't get it.
What is that I am missing here?
I figured out the issue (or a workaround). Posting my solution for any newbie facing the same issue:
Please note that my code is not in GITS or any remote repository, it is in Team Server hosted in the company data center.
I have a workspace created in VS2015 via which I mapped my Angular code and downloaded it on local machine.
VS Code Settings:
Make sure you have Azure Repos extension installed.
Go to File->Preferences->Settings (make sure User settings tab is selected)-> Extensions-> Azure Repos extension:
Provide the values for following fields:
(a) Tfvc: Location Example value for VS2015: C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\tf.exe
(b) Tfvc: Proxy
Example (this should be your team server name): https://dataCenter.myCompany.com:9100/tfs
(c) Tfvc: Restrict Workspace (this is optional, use only if needed)
Check the box
Goto View->Command Palette-> type Team: Signin, provide username and password.
Goto File->Open folder-> select the folder mapped via VS2015.
Once the folder is open, you will see all files inside the folder. Go to File->Save Workspace As and give it a name.
Now you should be able to see any changes done by you in either VS2015 or VS code. Check-in should reflect the changes for you and other users connected to the code.
Previous Mistake: I realized that I was using Gits:Initialize Repository (as advised on various sites) which was causing all the trouble of "Untracked" changes and other users' changes not reflecting in my code.
Thanks,
RDV

What is the path when using Team Foundation Version Control (TFVC) as the VCS for a Jenkins project?

I'm trying to connect a Jenkins project to a Visual Studio Team Services repository.
If I use the "Git" option for the VCS in the configurations (as I've seen in most tutorials), I get authentication issues, and entering my credentials does not remedy the error. If I use the "Team Foundation Version Control" option, it accepts the repository URL without any errors, but it asks me for the "project path."
So, my question is actually twofold:
(1) Since Team Foundation is now known as Visual Studio Team Services, is this option depreciated and thus not worth using in my configuration anyway? I haven't even seen it or heard it mentioned as an option in any tutorial I've gone through, so I'm not sure if it's even used anymore (I thought my version of Jenkins was current, but I guess it might not be, somehow.) If this option is outdated, what is the preferred method now?
(2) What is the "project path" that it is asking for? It says it must start with $/, so I'm not sure if that means it's the path to the project in the file system of the environment it's going to be running in (in my case, on a slave machine), or if it's referring to its path in the Visual Studio Team Services system or what exactly.
I've attached a screenshot below for reference. Any and all advice will be appreciated.
Jenkins VCS config screenshot
Regarding git authentication issue, you can use Personal Access Token (username can be anything, such as test) or Alternate Authentication Credentials. The same as TFVC.
Regarding the path, it is the server path of TFVC
Go to Code page of team project
Select Files tab
Select a folder
Get the path

Issues with TFS Aggregator implementation

We used TFS Aggregator to automatic update the User Story's state according to its sons state changes and also to automatic Update User Story's state of other project (if they are related).
Also important to mention that we hire an external freelance to help us doing it. When we tested it on his environment - it worked well. But when deploy it in
our environment - there's no change, the new functionality doesn't work.
what you recommend us to check ?
what can be the reasons for this integration problem?
What actions should we take?
Your advises are more than welcome!
First, try to follow the steps of installation on this website to install the plugin: https://github.com/tfsaggregator/tfsaggregator/wiki/Install
If it still doesn't work. Here is the troubleshooting page you can refer to: TFS Aggregator Troubleshooting:
You are using the right version of this server side plugin for the
right server. You can get multiple releases of this plugin at website
https://github.com/tfsaggregator/tfsaggregator
You have updated a work item that triggers a rule. (The TFS
Aggregation only works once a work item that has aggregation rules on
it is updated. This may change in a future version.)
If the rule navigates between work items, work items have a proper
Link (e.g. Parent-Child).
You copied the DLLs and the Policies file to the plugins location on
all TFS Application Tier Servers (Usually at: :\Program
Files\Microsoft Team Foundation Server {version}\Application Tier\Web
Services\bin\Plugins)
You have valid names for source and destination fields in
TFSAggregator2.ServerPlugin.policies.
When you saved the file you saved it as UTF-8 encoding (in Notepad++
it is called “utf-8 without BOM”).
You have given permission to the user running the plugin, e.g. add
the "TFS Service Account" to the Project Collection Administrators
TFS Group.
You may have to do this from the commandline using tfssecurity
/collection:http://server:8080/tfs/DefaultCollection /g+ "Project
Collection administrators" "LOCAL SERVICE" if your service account is
either LocalService, NetworkService or any other Windows Well-known
identity, since they are no longer shown in the permission UI.
When using the Impersonation option, make sure the user executing the
plugin (generally the TFS Service account) has the "Make requests on
behalf of others" permission at the server level
If you upgraded your TFS from 2013.x to 2015.* and from 2015rtm to
2015.1 and did not uninstall the TFS Aggregator before doing this TFS upgrade the aggregator does not work. Remove the TFS Aggregator from
the TFS 2013 Program Files folder or run the uninstall of the TFS
Aggegrator (backup your policies!). Then re-install the TFS
Aggegrator setup or install manually for TFS 2015 as described here.
Every TFS version has its "own" assembly for the aggregator so it is
important to use the right version against the right TFS.

Connect TeamCity to Visual Studio Online

I'm trying to migrate from on-premises TFS to Visual Studio Online. We have quite elaborate TeamCity build process that we don't want to migrate away from, so having TeamCity working with VSO would be ideal.
I've created alternative user credentials (as per this article) and using these credentials in TeamCity. But when I create new VCS in TeamCity, I get connection error:
TF30063: You are not authorized to access https://myproject.visualstudio.com/DefaultCollection/MyProject
I've tried my actual credentials (not alternative ones) but nothing changed - same error.
Also I've tried using alternative credentials with tf command line tool and could not enter alternative credentials - a window popped up, asking me for my LiveId.
Any idea how to fix this?
p.s. this is how TeamCity configuration look like:
To connect to Visual Studio Online you indeed need to enable alternate credentials on the account you'll use for Team City. Ensure that at least Team Explorer 2012 and update 4 is installed on the Team City server, install the whole Visual Studio 2012 incl Update 4. Team City requires at least update 2, but Microsoft only supports Visual Studio 2012 RTM and the latest update (which is update 4).
Then in the connection screen use the following information:
Repository URL: https://myaccount.visualstudio.com/DefaultCollection
Username: ##LIVEID##\your.email#live.com // Your visual Studio Online User Name, must match your LiveId.
Password: ********* // The password you setup for the alternate credentials.
You can also use the VSO Service Account credentials instead of using Alternate Credentials.
Then in your VCS Root configuration map your TFVC root in the following way:
Root: $/MyProject/Path/To/Branch/Root
Check out this post on the Jetbrains Confluence site for more details.
This has changed lately and the password needs to be generated.
Navigate to your site at https://[your project].visualstudio.com/_details/security/tokens
And generate a personal access token. And use it for password in your teamcity vcs root configuration. Username is your email.
https://streamlined.no/2016/09/19/connecting-teamcity-10-vcs-root-visual-studio-team-services/
Note: TeamCity 10 does not need the ##LIVE## workaround anymore.
I had the same problem today. The TC instance which was working fine last week mysteriously could not connect to any VCS Roots after the weekend. All VCS roots are git repos in visual studio online.
The Test Connection was failing and changing to known working user accounts still failed.
Restarting the TC service also had no impact on the problem. In the end, rebooting the whole TC Server fixed the issue. Hopefully this will help someone else out.
Well, I could not use Alternate credentials as I use it in many build configurations and it was set up to poll every 60 seconds. So I had to do much manual work to fix it up. Instead, I generated a Personal Access Token and in the Team City VCS setup for Git I entered "username" as the username and pasted the PAT into the password. That worked much better and more stable than Alternate credentials, which kept getting disabled because of background polling on behalf of Team City.

team foundation server (TFS) in the cloud not able to delete / adjust mapping

I tried out the TFS Service with a project of mine. After I experienced some problems (probably misuse) I used VSUnbindSourceControl.exe (see: http://vsunbindsourcecc.codeplex.com/) to detach the project (locally) from the TFS, but it looks as if on the server side, the project that was uploaded, is still bound to my computer.
See image:
and the error message in the output window:
Failed To Create Mapping
The working folder G:\Quant tool DotNet4 is already in use by the workspace USER-PC;myemail# somedomain dot com on computer USER-PC.
(I now use a different email address than the one above)
I've tried to delete the project from the server via the Source Control Explorer in VS, but the delete option is disabled. (also when I login with mldz at hotmail dot com.
I was also not able to delete the project or change it's settings via the TFS web interface.
Anyone experience with this problem and how to solve it with the new TFS in the cloud? i saw some similar problems with a normal TFS and some solutions could be done via the the team foundation administration tool, but that cannot be applied to the TFS in the cloud (AFAIK)
Some info about trying to install TFS integration tool
Hi,
I use VS2012 express and although I installed vs_teamexplorer.exe,
I'm not able to install Microsoft Team Foundation Server Integration Tool.
Already restarted the computer after installation and tried again. Doesn't work. Missing something?
regards,
Matthijs
You can use the same admin tools for tfs.visualstudio. See examples. At end of http://msdn.microsoft.com/en-us/magazine/jj130558.aspx article which show deletion of workspaces, for example.

Resources