TFS in Visual Studio 2012 under Windows 8 - visual-studio

I'm having trouble connecting to the hosted Team Foundation Service using Visual Studio 2012 RC.
Upon my first connect, a window was opened prompting me for my username and password, however I was added to TFS with a different Live ID. I've re-registered a new Live ID and now I can't get access to TFS. When I try to do so, I get this error:
TF31003

If you log out from All Live accounts in your Browser's and then try logging into TFS again you should be prompted for the credentials and you can login with the account that has access to TFS Preview.

I got the tf31003 error while trying to connect to a hosted TFS at https://mycompanyname.visualstudio.com/
I could access the site using my Live Id through Firefox but when trying to connect using VS 2010 I was getting that error.
The issue with my case was that VS2010 was trying to login using Internet Explorer which I was signed in under a different account. To solve this I opened Internet Explorer and logout from Hotmail/Live and went to the about URL and connected to the TFS instance, which connected successfully.
After that I went back to VS 2010 and tried to connect to the server again, this time I was shown the Login window where I was able to enter my login details. Once done my server was successfully added to the 'Team Server Foundation list' and was able to get the list of all my projects.

I had the same problem, except I am running VS2012 Update 2. This is overboard, but this is a thorough list of everything I did that eventually fixed it.
Ensured Visual Studio was not running
I opened Internet Explorer, pressed CTRL+SHFT+DEL, selected everything and clicked "Delete"
I opened Fiddler and navigated to "Tools > Clear WinINET Cache" and "Tools > Clear WinINET Cookies"
I opened the windows Credential Manager and removed all entries (including all Web Credentials, Windows Credentials, and Generic Credentials)
I disconnected my Microsofot account from my Windows account
Opened Visual Studio and connected to TFS, and it finally prompted me to login
Again, this is overboard, and not very surgical, but as I was in a hurry, so I decided to take the shotgun run, and it worked.

I had the same issue, the simplest solution I got was to delete just three cookies.
I found this recommendation in other post. It worked for me.
cookie:*#login.live.com/
cookie:*#visualstudio.com/
cookie:*#tfs.app.visualstudio.com/
To see the cookie files directly so to "Internet Options -> In the Browsing History Section Click "Settings" -> Click "View Files" -> They are all text files.

I received this same error (TF31003 / TF30063) when setting up a new TFS Build Server on Windows Server 2012 because Active Scripting was not enabled in IE.
In order to login - you must enable active scripting to see the login prompt below...
I actually discovered this after installing Visual Studio where the popup dialog specifically informs you of this required setting. Hopefully this will save sometime hours of lost time...

Related

TF30063:You are not authorized to access dev.azure.com but I can connect

I am using Azure Devops and VS2017 15.9.7.
I am logged into Devops and can sync.
When I open my project I get a message
"TF30063": You are not authorized to access dev.azure.com/myproject
I have tried going into credentials manager and deleting all the credentials for the devops organisation.
I have looked at this question and tried logging out via the browser within VS
TF30063:You are not authorized to access dev.azure.com but I can connect
I have encountered the same issue. (I need to switch back and forth between work account and test account). Of course, there could be so many reasons and it could be different for each (cached another account, or modified the password).
To resolve this issue I have two methods/steps.
Step 1 is to clear the credential from credential manager:
Go to Control Panel (with small icon view)-->User Accounts-->Manage your credentials (on the left column)-->Select Windows Credentials-->Scroll down to the Generic Credentials section and look for your TFS server connection.
Step 2 is to click on the operation that Connects to the Team Projects which is the button/plug icon in the Team Explorer tab. Then to also right click the project you are getting this issue on and select Connect:
I also have tried other methods but not work for me, if possible, you can check if it is useful to you:
How To Fix TF30063 Error
Error TF30063: You are not authorized to access
The comment by Kirsten Greed in the accepted solution resolved the issue for me. Reproduced here:
The problem was that I was opening the project using the Recent Project section of the start page. I closed VS, re-opened and then opened the project via "connect: in Team Explorer. Then exited. Now it seems to open ok either way.
I had the same issue, It solved by simply rerunning the Visual Studio as Administrator.
Running this command in cmd prompt, forces the re-authentication screen to come up and worked for me:
tf.exe get . /r
NOTE: you may need to locate tf.exe on your disk. For instance I have it at this location: C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\TF.exe
Another reason for this error is that you might have to re-enter your credentials in Visual Studio:
Restarting Visual Studio and connecting to Azure DevOps did the trick for me.
If the is problem like below:
The solution will be like below:
And after that select:
Re-enter your credentials
Step 1: Add
"C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer" in the environment variable path
Step 2: remove azuredevops org related credential from credential manager
Step 3: Delete this folder:
C:\Users<UserName>\AppData\Local\Microsoft\Team Foundation\7.0\Cache
Step 3:
run tf workspaces /collection:https://dev.azure.com/royalmailgroup in cmd
It might be the case of a password change.
In my case I had update my account password in a different machine. So on machine #02 I went to Visual Studio > Account Settings. After the pop-up opened, there was a message to re-enter credentials.
Sometimes the password isn't updated across all used app/services and you have to enter that manually.
Hope that helps.
None of the other methods above worked for me. I tried this in visual studio 2022 and it worked.
Open the Developer PowerShell (search for PowerShell) and type in the following:
TF vc permission
This will bring up a login screen and allow you to log in.
After that you should have permission.
In Visual Studio>Navigate to Tools > Nuget Package Manager >Package Manage Settings>Azure Service Authentication>Verify/Change the account
Leo Liu's answer got me on the right track. My problem could have originated from having two different Azure DevOps accounts cached in Windows Credentials and Visual Studio started choosing which one to authenticate with at random.
Log out of both accounts in Windows Credentials.
(The Manage Connections window does not have access to source control now.)
Open up the Azure DevOps website and logout there.
Login on Azure DevOps website.
(Visual Studio's Manage Connections can access source control again.)
What did it for me was open VS without code and connect via Team Explorer, but then also it threw the same error and after some time I logged out of azure web and tried connecting via Team Explorer again and it worked.

AAD-Authentication not working since Visual Studio 2017 update to version 15.7.4

I have Visual Studio 2017 Enterprise 15.7.4 installed on Windows 10. The OS is connected to my AAD Work/School account. My problem occurs on 5 different machines and started to appear today.
When I start VS I'm logged in (top right) and every thing is fine. The list of subscriptions is shown in Cloud Explorer too.
I now open a ASP.NET Core web project and want to publish it to an existing Web App in Azure. As soon as I'm in the screen where I can define the target subscription, VS starts to re-authenticate eventually showing the popup-dialog querying for my credentials. This dialog sometime appears several times in a row.
I can authenticate without any error shown and now everywhere in VS (Account settings, Cloud Explorer, Server Explorer, Publish Dialog) appears the "Reenter your credentials" link and all subscriptions are inaccessible now.
From this moment on there is now way to authenticate against AAD inside of VS without getting the "Reenter-thing" anymore.
What I already tried:
Went to account settings and removed all existing accounts from VS -> restarted VS and performed signup again.
Closed all VS instances -> deleted the file system folder %LOCALAPPDATA%\.IdentityService -> started VS and signed in again
Right click on Azure Node in Server Explorer and selected "Connect to Microsoft Azure Subscription..."
Nothing of the above works. I was able to use this stuff just 2 days ago. That's why I suspect the update.
I then tried to post a question on Visual Studio Community Site. This asks me to use the "Report a problem"-feature in VS. Guess what? The sign-in is broken there too so I cannot even get my problem to MS.
Any further suggestions are highly welcome.
Have you tried out to use a none Windows User - create a blank User on your Subscription and deploy with this user...
Maybe a problem with windows integrated User?
Best
Niels
Today it was just announced that there is a new feature in preview in AzureAD - maybe that’s the reason?
See
https://cloudblogs.microsoft.com/enterprisemobility/2018/06/19/azure-ad-password-protection-and-smart-lockout-are-now-in-public-preview/
Update
Maybe just refresh the User Tokens...
Use this PS lines…
$cred = Get-Credential
Connect-AzureAD -Credential $cred
$user = Get-AzureADUser | Where-Object {$_.UserPrincipalName -eq "your_aad_login_name"}
Revoke-AzureADUserAllRefreshToken -ObjectId $user.ObjectId

TF400324: Team Foundation services are not available from server <Server/CollectionName> in Visual Studio 2012

When I open my existing solution in Visual Studio 2012 professional, I got the above error. This used to work but something messed up after the computer is rebuilt.
I have installed Visual Studio 2015 Community and can connect to the same
collection correctly.
I also tried to use a browser to connect to the same collection. It works fine also.
Cleaning all files in AppData\Local\Microsoft\Team Foundation\4.0\Cache does not work.
It should not be a firewall or proxy issue since Visual Studio 2015 works.
Anyone knows what is wrong with Visual Studio 2012 and how to fix it?
Edit:
This error can happen with later versions of TFS:
Team Foundation Error
TF400324: Team Foundation services are not available from server TFSServer\DefaultCollection.
Technical information (for administrator):
Unable to connect to the remote server
A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond xxx.xxx.xxx.xxx:443
According to this blog the solution is (and Yes it worked for me)
Close all instances of Visual Studio
Open the Task Manager and check if any TFS Services are running. Select each of them and click on End Process Tree (in my case I did not find any of them to End)
Browse to the folder %LocalAppData%\Microsoft\Team Foundation\
and then select the folder with your TFS version and go inside the Cache folder.
for example, in my machine the path was %LocalAppData%\Microsoft\Team Foundation\7.0\Cache and it should be the same on your machine with the difference of the TFS version folder name.
Delete everything in that Cache folder.
Start Visual Studio and build the project
I got this error in TFS2017. For me the problem was a Self-Signed Certificate.
Open the TFS URL in IE and you will see a Red Address Bar:
Click the "Certificate Error" in the address bar:
Then select "View Certificates":
If clicking "View Certificates" doesn't work, right click on page > Properties > Certificates.
If the Install Certificate button is hidden to make it visible you will have to Open Internet Explorer Options > Security > Sites > type the TFS server URL > Tick Require server verification > click Add. (If the dialog is disabled see the guide Trusted Sites Dialog is Disabled at the end of this answer).
Once you have the install certificate button available, select “Install Certificate”.
This will launch the Certificate Import Wizard. Make sure to Choose the option “Place all certificates in the following store” and select browse.
Select Trusted Root Certification Authorities and click Ok.
Click Finish on Completing the Certificate Import Wizard:
Click yes on the security warning to install the certificate.
=================================================
Trusted Sites Dialog is Disabled
You can check to see if the site is Trusted, on Windows 7 the path is:
HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMapKey
The key should contain several string values with a name indicating the URL and numeric data indicating the zone, one of the following by default.
0 = My Computer
1 = Local Intranet Zone
2 = Trusted sites Zone
3 = Internet Zone
4 = Restricted Sites Zone
If the TFS site is not listed in the registry then add it manually. Restart Visual Studio and try to connect to the TFS server again from Visual Studio. Once you can connect you can also remove the TFS server from the Connection List. I suggest removing it and adding the FQDN url which will most likely already have a Trusted Site rule.
Edit
Hit this again. This time it was caused by a problem with a network card that was replaced on the weekend by our telecommunications provider.
This issue is happening when server is not responding, In my case server hosting TFS was down, we restarted and get connected.
Try clear both local TFS cache and Visual Studio Cache
clear visual studio cache under
%APPDATA%\Microsoft\VisualStudio
clear TFS cache under
%LocalAppData%\Microsoft\Team Foundation
...better late than never...
I just had a user run into same error TF400324 connecting VS2012 to TFS2015 (hosted in a virtual private cloud). TFS Web Access worked fine for her, but Visual Studio 2012 UI was stuck in offline connection.
FIX: She managed to get VS connected again after clicking Team Explorer > Connect | {TeamProject}, Then select desired Team Project below the TFS Server connection (see screenshot attached).
NOTES:
I suspect clearing client-side TFS cache might also fix, but all VS instances would need to be closed then "Connect to Team Project Connection" re-established. Just disconnecting and reconnecting VS to TFS did not clear the "offline" state.
Error she saw was in VS output window:
This solution is offline. [Team Foundation Server: {//TFS Collection URL}]
The solution was offline during its previous session and will remain offline.
TF400324: Team Foundation services are not available from server .
Technical information (for administrator):
Page not found.
NOTE: I recently moved TFS to different domain requiring SSH connection and localhost port mapping. I have users going offline much more frequently due to different proxy routing depending on whether they are at work or connected more directly to the Internet.
For me the fix was simply running Visual Studio (2010) as an administrator.
In my case, my company VPN my Host machine was connected to was preventing me to access the tfs on a VirtualBox VM, returning this exact error message.
We solved it by adding a specific exclusion to ESET / Kaspersky AntiVirus for the devenv.exe
"C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\devenv.exe"
Its been working great ever since.
I get basic idea from this link
Soluton for me was to run the standalone TFS installation. This is for 2017, but worked to fix my VS2019.
https://visualstudio.microsoft.com/thank-you-downloading-visual-studio/?sku=TeamExplorer&rel=15
Bit of background...
I'd been having this issue since 2017. Tried all the usual suggestions on here, cache clearing, config file editing etc. but would always have to come off my organisation's network to check code in, as it was proxy related. TFS was trying to connect to a proxy server ip that had been decommissioned, no one from the service desk could work out why. Couldn't find any reference to this old ip in any config files.
Installed VS2019 hoping it would solve the issue but it persisted. Eventually I thought of trying to uninstall it as a component and re-installing it. Couldn't find a way to do that but in my search I found the standalone installer for Team Explorer, albeit for VS2017.
After installing, I ran this, opened up Manage Connections in the Team Explorer connections page and did what I needed to connect to the repository from there. Worked first time. Closed Team Explorer 2017, opened my VS2019, and everything seemed fine in there as well.
Amazed my problem is finally solved!
This error is usually related to the TFS cache. Before you clear the cache folder, please make sure you have closed all instances of Visual Studio and also try to open Task Manager and check if any TFS Services are running. Select each of them and click on End Process Tree.
And also clear the server cache Server cache, the path like C:\ProgramData\Microsoft\Team Foundation\Web Access
Then restart Visual Studio and run as Administrator Mode.
More details you can refer this blog (archived version at the bottom) and also could try the better fix.
Note: Make sure you are working on a different workspace rather then VS2015's.
For me it was the windows firewall causing this problem : TF400324 The underlying connection was closed.

Visual Studio 2012 won't let me log out of TFS so I can enter new username/password

I've been trying to disconnect or remove my credentials from a machine because of a conflict. However, whilst connecting to the remote TFS server I was asked for credentials, I cannot find a way to log out of the TFS and log in with new credentials to resolve. How can I drop the credentials or simply log into TFS as a different user. This is driving us crazy as we have a mapping conflict issue.
Currently the login to TFS and on VS is different from that of the machine. Is there a way I can just start again.
Check the Credential Manager:
Control Panel\All Control Panel Items\Credential Manager
There should be an entry for your TFS and your account. Just delete it and you should be asked again for credentials when connecting VS with TFS.
In my case the solution of Navanod didn't work.
What worked for me was adding the TFS-username to the TFS Server URL separated by the at-sign (#).
As follows:
The easiest way that I found for logging out of TFS from within Visual Studio is:
In Visual Studio select: View -> Other Window -> Web Browser
Type in your TFS Server URL in the URL Field (This means using VS, browse to your TFS url: MyName.visualstudio.com)
Sign out
Now if you try to connect to your TFS Server, VS would prompt you for Username and Password.

TFS/Visual studio 2010: Clear cached password for TFS in Visual Studio 2010, Need it to ask me to login again

I am using Windows 7 and i installed TFS Server and connected to it from my VS 2010 install. It prompted me for a password so I entered the admin password.
All went well, now i added myself as a user but i can't get it to ask me to login again. It is remembering (caching) the password. Hence it always logs me in as Administrator.
I search the Internet and some people recommend ClearCred.exe which ships with VS SDK but it doesn't anymore ...
And then checking the managed credentials in windows 7, i have also checked this and i see nothing with regards to my cached TFS password.
I also tried removing the TFS server connection from VS 2010 and readding it .. but it remembers me as Administrator.
Can anyone help?
Open the Start Menu and type "Manage Network Passwords" and open the control panel applet that shows up in the results. Then, you should see the credentials in the list where you can expand the item and "Remove from vault."
You need to remove TFS credentials from Windows Vault to clear and force to ask new TFS credentials in Visual Studio
Go to Control Panel (Start -> Control Panel).
Click User Accounts ( or User Accounts and Family Safety->User Accounts in Windows 7 Machine)
Click Credential Manager (or Manage your credentials)
In Credential Manager page, you can see the two type of credentials
i. Windows Credentials
ii. Generic Credentials
Click on two credentials modify link, click the link Remove from vault to remove stored TFS credentials.
Now, When you login into Visual Studio you will be asked to give credentials to connect TFS.
Note: Don't forgot to uncheck the option Remember my credentials to force to ask credentials for every TFS connections.
I had the same problem and after much googling found this link which fixed my problem i hope it works for you aswell.
http://www.richard-banks.org/2010/07/how-to-remember-my-password-with-tfs.html

Resources