Error TF31004 connecting VS2012 to TFS - visual-studio-2012

I am trying to setup a new connection to TFS with VS2012. Early on I was able to add my TFS server and, using the Microsoft Git Provider, clone a copy of the remote repository from within Visual Studio. Later, as I was fiddling with things in Team Explorer trying to find the branch I wanted to use, something broke. My local repository remains, but my connection to the remote repository was somehow corrupted, as evidenced with this error:
TF31004: Unexpected error encountered while connecting to Team Foundation Server at http: //my.server.com:8080/tfs. Wait a few minutes and try again. If the problem persists, contact the server administrator ok help
Things I have tried to resolve this:
Wait and try again (as the error message suggested).
Restart Visual Studio.
Reboot my machine.
Reboot TFS server.
Use system restore to revert back before I installed msysgit and Microsoft Git Provider, or had attempted to connect to the TFS server.
Review the MSDN help for the error (see below).
Search Stack Overflow (found one other related issue but did not seem to apply).
Tried devenv /ResetSkipPkgs
Tried devenv /setup
Re-install Team Explorer for VS2012.
Clear IE cookies (per this post).
Clear TFS caches (per this post).
The help page offers these tidbits, but none of them seem likely given that I had, as I said, the connection working at one point:
The version of Team Foundation running on the local computer does not match the version running on the Team Foundation Server server {name}.
The server returned HTML content instead of XML content.
The required Web service on the server could not be found.
Any ideas would be appreciated!

I have had an exactly the same problem.
My solution was to clear all the credentials in the Windows Vault (Credential Manager residing in the Control Panel).
I have no idea why the credentials did get messed up.

Related

.Net core 3.1 sudenly stoped thowing HTTP Error 500.31 - ANCM Failed to Find Native Dependencies

Everything was fine until yesterday. This must be due to Windows update. No one touched the server. I have tired couple of similar solutions posted in Stack Overflow(all are old questions),none of them worked for me. What I have, Server Windows server 2019, APP netcore 3.1 ,IIS version 10. .net core runtime and SDK both are installed. This was working before. No one touched anything, just stopped working
In the browser appearing
HTTP Error 500.31 - ANCM Failed to Find Native Dependencies
When I executed on the command line
A fatal error was encountered. The library 'hostpolicy.dll' required to execute the application was not found in
When I checked event log. Something like below appeared. But let me tell you in the build
directory we don't have a file like app.runtimeconfig.json
What I have tried
Repair .netcoe runtime and SDK
Restore old DB backup
Reinstall .netcore versions
No pending Windows updates
Restart IIS APP pool also the server
Check file permission
None of them worked for me. If anyone can help, really appreciate.
For this issue, we can't find out that the environment of windows server caused by windows update is abnormal. As you said, it worked fine before.
So please allow me summarize below suggestions as answer.
Suggestions
Copy the publish file named original_file . And paste it in our dev pc or other server which have IIS Management. And test it, this publish file should be works. This step just confirm the publish file is normal.
Create a new website and a new application pool. Create a new asp.net core3.1 application and deploy it. Then check if it works properly under this new site.
The site should be fine in the second steps, and replace it with the original_file. And the application also should be works fine.
The site can't work in the second steps, it means the environment in you server has some problem. It could be registry issue or ApplicationHost.config issue in IIS and so on. If it's very important for you, you can rasie a support ticket and let official engineer help you to figure out what happend in this windows Update
After the third step, if the new site can run the original_file file well. We can compare ApplicationHost.config between the new site and the original one to see if any settings have been changed.

Unable to connect to TFS 2010

Just recently my project has been going Offline and I'm unable to connect to TFS 2010 from my instance of Visual Studio (2012). When I try to connect via the VS Team Explorer window I get:
TF31002: Unable to connect to this Team Foundation Server
In the Output window of Visual Studio it looks like it repeatedly tries to connect:
....
This solution is offline. [Team Foundation Server: http://mycollection:80/tfs/defaultcollection]
The solution was offline during its previous session and will remain offline.
This solution is offline. [Team Foundation Server: http://mycollection:80/tfs/defaultcollection]
The solution was offline during its previous session and will remain offline.
This solution is offline. [Team Foundation Server: http://mycollection:80/tfs/defaultcollection]
The solution was offline during its previous session and will remain offline.
HTTP code 404: Not Found
This only seems to be impacting me, and not others in my team. I've changed my password on the off chance it had expired, and I've also restarted my machine. A few tips have been to run a TFS tool (which I don't have as it's not a local install of TFS) or are VS2013 specific.
Does anybody have any tips I could try locally to try and connect to the server?
I managed to find a solution to my particular problem, it seemed to be caused by the Cache file for TFS.
To resolve it I went to
C:\Users\[User]\AppData\Local\Microsoft\Team Foundation\[Version]\Cache
I then cleared this directory of all files and restarted Visual Studio.

Using TF.exe with Team Foundation Service?

We're moving our build from Team Build (Team Foundation Service) to a local build machine using Jenkins CI for build. However, we still want to use the Cloud for Source Control. So now we need to access the cloud TFS to get the latest build.
Jenkins has an TFS Plugin, but that was made for TFS 2008.
Now I have the problem that I'm not able to access the cloud TFS with TF.exe from VS2012.
I found an article here that showed me the difference between TFS 2008 and 2010 (I need to add /tfs/DefaultCollection to the server URL), but that didn't work with the cloud TFS.
Here's the error:
TF31002: Unable to connect to this Team Foundation Server: https://myserver.visualstudio.com/tfs/DefaultCollection.
Team Foundation Server Url: https://myserver.visualstudio.com/tfs/DefaultCollection.
Possible reasons for failure include:
- The name, port number, or protocol for the Team Foundation Server is incorrect
.
- The Team Foundation Server is offline.
- The password has expired or is incorrect.
Technical information (for administrator):
The Remoteserver returned an error: (404) Not found.
I've tried it with and without the /tfs/DefaultCollection. Same result.
Documentation, according to what I have found, is next to nothing.
Has anybody had any success accessing the cloud TFS with TF.exe?
EDIT: browsing through other articles, I saw that others did it without the /tfs, so just add /DefaultCollection
(thanks to Microsoft for changing the URL with every version...)
However, the output is still crap.
C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE>tf workspaces -format:brief /server:https://myserver.visualstudio.com/DefaultCollection /login
:myuser,mypassword
Result:
No workspace matching *;[NAME OF ANOTHER USER] on computer MYMACHINE found in Team Foundation Server https://myserver.visualstudio.com/DefaultCollection.
ok, found the solution...
Add "/computer:*" if no workspace was mapped on the machine running tf.exe before...
Conclusion:
The URL to connect to your collection in TFS changed in every version.
TFS 2008: mytfs
TFS 2010: mytfs/tfs/DefaultCollection
TFS 2012: mytfs/DefaultCollection
OMG..

Error TF30063: You are not authorized to access ... \DefaultCollection

I'm using TFS Preview (Team Foundation Service) with one of my projects with Visual Studio 2012. I'm also using an on-premises TFS server with most of my projects. When I use my on-premises TFS after using TFS preview and go back to using TFS preview, I get this error:
TF30063: You are not authorized to access MyProject\DefaultCollection.
If I go to Team → Disconnect TFS and then connect to TFS preview again, I'm able to see a "Loading identifiers" loading screen coming up, but in the end I don't get to enter my credentials to TFS preview (my Microsoft account) and as a result, the TF30063 error still occurs.
I suspect this has something to do with my Microsoft account (i.e. Live ID). I'm logged in to Windows with the same Microsoft account that I use at TFS preview. I have logged in to other sites (Windows Development Center, MSDN, etc.) with other Microsoft accounts, but I verified that if I log out of these services and re-login with the correct Microsoft account, I still get the TF30063 error when I try to log in to TFS preview from Visual Studio.
When I came accross this issue none of the provided answers solved this problem or if it did I didn't like recreating the project. The way I ended up solving the issue:
Clicking on the "Connect to Team Projects button" (The plug next to the home button in the Team Explorer tab)
Right click the project you are getting this issue on.
Click Connect.
I guess the "Remember me" cookie timed out but gave me a generic response for trying to push or pull any code.
I solved this issue by using the browser from within Visual Studio, View->Other Windows->Web Browser; Ctrl+Alt+R (or * Ctrl+W, W* in VS versions before VS2010) to navigate to the TFS page and log out of the wrong account and log back in.
For me, the issue was caused by using another live-id to unlock a windows phone for development. Somehow the credentials got cached, it seems.
For me the error came after changing my password for my AD account.
I had to remove the line from credential manager (which contained the previous password.)
Then it worked again.
I have upgraded TFS 2015 to TFS 2017, and then the TF30063 error occured on one of my client machines. None of the solutions here worked...
For me the only solution that worked was running the following command from the Developer Command Prompt:
tf workspaces /collection:https://tfs.xxxxx.com/tfs/DefaultCollection
Of course, you need to adjust the url to the valid one.
Source: https://www.visualstudio.com/en-us/docs/setup-admin/tfs/admin/backup/refresh-data-caches
The TFS Preview login apparently uses Internet Explorer and thus might conflict with other MS Accounts you are using. Fully clearing the IE cache seems to work for me. After the cache clearing, I get to the correct login screen and may enter my credentials as needed.
I tried all of the suggestions here. None worked. This could be my particular situation where I connect some VS instances to our company TFS and some instances to my private TFS.
The only way to solve it for me is to close all VS instances and start a new instance.
Oddly enough, connecting to the internal TFS is never a problem. Connecting to *.visualstudio.com sometimes raises this issue.
In VS 2015 it can be achieved by
Team Explorer > Connect > Manage Connections
and selecting the team project again. In case of there exist more than one account in VS, Team Explorer asks for which account to use to connect to the team project.
I tried the following to resolve this issue. Hopefully one of these will work for you
A - Close VS then start the VS Developer Command prompt as an administrator. Then enter: devenv /resetuserdata
B - Clear the cache in IE (apparently VS uses this to access your account mentioned here)
C - Click View -> Other Window -> Web browser (CTRL+ALT+r) sign in to your old account, log out and sign in to your new one
D - Open the folder containing you solution, delete (backup if you want) the Visual Studio Source Control Solution Metadata File delete the .suo file and open the .sln file in Notepad and delete the below section
GlobalSection(TeamFoundationVersionControl) = preSolution
SccNumberOfProjects = 6
SccEnterpriseProvider = {**********************}
SccTeamFoundationServer = theServer
SccLocalPath0 = .
SccProjectUniqueName1 = pro
SccProjectName1 = myProject.BL
SccLocalPath1 = myProject.BL
.....more stuff.....
EndGlobalSection
The last step was required because, while I had managed to disconnect VS my solution was still trying to connect to the old source control account.
Make sure that Windows Authentication hasn't been disabled for the Website / Application within IIS.
I'm not sure HOW this happened, but I did uninstall Hyper-V today to be able to install VMWare Player and then re-install Hyper-V
Reenabling this allowed everything to work again.
In team explorer I removed project... then in Manage Connections, clicked on 'Connect to a Project...'
In this screen choose your project then click on Connect... this solved my problem.
This happens to me regularly, and none of the solutions described above works every time.
Most of the times the solution where you use the "Connect to Team Projects button" works fine, but sometimes nothing happens when I do this.
Other times I simply have to re-login to http://tfs.visualstudio.com using the Visual Studio built-in browser (Ctrl+Alt+R) or via Internet Explorer.
(As suggested in some of the other answers, for my part this is not caused by multiple live-ids)
None of the current answers worked for me. I found a solution here.
The issue was that my previous credentials were cached by the Windows
OS for the TFS server. While some people might have had success wiping
out the AppData temp folders, that is not required.
You need to update the credentials through Control Panel on the
Windows OS.
For me on Windows 10: Close VS. 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. Expand
the pull down and click "Edit". Enter in new network password. Reopen
VS and everything should work again.
Just restarting the visual Studio would do the job. As I did this and it worked like a charm
I have just removed the server from Team Explorer, then added again, and it worked =).
When Visual Studio prompted me for Visual Studio Team Services credentials there are two options:
Use a "Work or School"
Use a "Personal" account
In my situation I was using a work email address, however, I had to select "Personal" in order to get connected. Selecting "Work or School" gave me the "tf30063 you are not authorized to access..." error.
For some reason my email address appears to be registered as "personal" even though everything is setup in Office 365 / Azure as a company. I believe the Microsoft account was created prior to our Silver Partnership status with Microsoft.
Disconnect from Team Fountation Server under Team Menu and reconnect it from Connect Tab under Team Explorer Window
I got this error, after all fiddling work I could do — the disk space was full!
Clearing it fixed my issue.
I was also facing the same issue as you did. Here is what I did to solve:
METHOD 1
Click the 'Connect' icon just next to Home icon in Solution Explorer.
Choose your project > Right Click > Connect.
Try Check-in the project and this time it will happily proceed.
This is what I tried, and I did not need to logout from any sessions from TFS or VS Account.
METHOD 2
Just press refresh on the top of Team Explorer.
Try to Check-in.
This is also easy method.
Hope this helps.
I had to "run as a different user" to get Visual Studio to connect using my TFS account. It seemed to be trying to use my Microsoft account instead.
Text and image from: https://www.visualstudio.com/en-us/docs/connect/connect-team-projects
To change accounts
To run Visual Studio under an account that is different from your logged on Windows account, open the context menu for devenv.exe to access your run as options.
You can locate the executable in the following folder: Drive:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE.
I've experienced this issue after an TFS upgrade, and somehow Visual Studio is caching invalid login credentials. I've found two ways to fix it, first, using this answer I completely reset Visual Studio, then reconnected:
Click on menu Tools → Import and Export Settings → Reset all settings → Next → "No, just reset settings, overwriting all current settings" → Next → Finish.
For some strange reason, after the reset it connected without issue (I didn't even have to re-enter my credentials or reconfigure TFS after the reset).
The second approach was easier. First close all instances of Internet Explorer and Visual Studio, then open Internet Explorer and browse to TFS, login, then open Visual Studio again and attempt to connect to TFS one more time.
I finally found the right answer for me on the web.
For me it happened after I changed my password and Windows cached the TFS password. It is require to be updated manually. This is one way to do it:
Solution found at: developercommunity.visualstudio.com
CREDIT: Lavente Nagy! Thanks so much!
Fix Summary:
I found a solution, and it works on Windows 7/Windows 10 too. The steps are the same:
Close Visual Studio. 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. Expand the pull down
and click "Edit". Enter in new network password. Reopen Visual Studio and
everything should work again.
Check the information in registry :
HKEY_CURRENT_USER\SOFTWARE\Microsoft\VSCommon\Keychain\Accounts and delete the related keys under Accounts section.
Clear the cache in these paths:
%localappdata%\Microsoft\TeamTest
%localappdata%\Microsoft\Team Foundation
%localappdata%\Microsoft\VisualStudio
%appdata%\Roaming\Microsoft\VisualStudio
Hope this will work.
Note: By doing this may clear all the cookies and caches and load the Visual Studio New.
What isn't officially an answer here, but worked for me (the other answers didn't help):
Click Team Explorer tab -> Connect hyperlink - connect\choose repository. And it works.
Make sure your password hasn't coincidentally expired exactly on the same day you decided to install a new dev machine.
If you can't even log into TFS using the web interface then this may be the case.
Now I got the solution to the problem which I have faced:
The TFS remembered the prior password when I got logged in by using my mobile VPN.
Solution:
Resetting the account that I used to connect using VPN
I get this problem when I am forced by our IT security policy to change my password. After a password change, when I connect to TFS using VS2017, I am no longer authorized to access our TFS server and get the TF30063: You are not authorised to access ...:8080/tfs error message.
However, if I connect using VS2013, I can connect to the server without problems and the access denied error with VS2017 goes away.
It would be a lot easier if the error message were to tell us the username it's trying to access TFS with.
I've been coping with this for a while, and usually logging back in only for the next day to stop again.
I found I had two accounts and removing the unwanted one fixed the issue.
This is under Help > Register Visual Studio
Try making Internet Explorer your default browser temporarily.
In my case I had a proxy. I had edited the devenv.exe.config and set the proxy there. But today I changed the proxy domain password and TFS failed (menu View → Windows → Browser also failed). I could of course have edited the devenv.exe again. But there was a solution to remove it altogether. A brilliant one. It is given here.
Open menu TOOLS* → Extensions & Updates.
Click on Updates... in the left-hand menu
Here it asks for password and restarting Visual Studio. All okay. For more info, look for the answer in the link.
press Win button, then type credential manager and open it .
Add generic credentials.
Go back to team explorer, add the server again.

Debugger can't connect when starting local azure project

Ok, first of; here's what I did:
Install AZURE tools
Reboot
Start Visual Studio - new Azure project
Add web role (asp.net MVC 4 beta web role)
Hit F5 (debug)
It starts up the storage emulator and the compute emulator and starts to load in runtimes, and then I get a popup saying that the debugger couldn't connect.
Then after some googeling I'm suggested to try to run the application without running the debugger to see if I can acces the application. When I do I get this:
So I figure that IIS does not have permissions to access some file/directory. So I go to IIS and look up the application pool running the app, and it tells me that the identity in use is NetworkService, then I go give NetworkService full permissions to the entirety of the folder IIS has set for the application (which also happens to be the path to the project dir). Still I get the same error. Now I'm more or less out of ideas, but I try one last thing, which is to also give IUSR full permissions to the same dir, but this did not help either.
How can I go about resolving this problem? I haven't tried actually launching my project to Azure yet, cause if I can't even get it to work in development I don't see much point. Any and all help would be appreciated.
I ran into the same error today after uninstalling .NET 4.5/Visual Studio 11 Dev Preview, then installing ASP.NET MVC 4 Beta (this is before Feb 29th when the updated VS 2011 Preview drops).
Since I uninstalled .net 4.5, you just need to do an "aspnet_regiis -i" to ensure the .net framework (4.0) is set up with IIS 7.x this worked for me.
Edit: This will work if you uninstall/then manually install Visual Studio 2012 RTM as well.
I had a similar error yesterday. For me the problem was that the output of the build was empty in the target folder.
I tried to answer a similar question https://stackoverflow.com/a/9411422/182371:
Check %UserProfile%\AppData\Local\dftmp\IISConfiguratorLogs\IISConfigurator.log
file for the error messages. Mode details at
https://stackoverflow.com/a/8432621/182371
Make sure that the build output of your project is not empty. You can do this by going to IIS, find the site with the name similar to
'deployment16(6).WindowsAzureProject2.WebApplication3_IN_0', right
click --> Explore.... Make sure that this folder is not empty and
contains all the files required to start a web project successfully.
As for the Access Denied error:
it could be just an IIS default setting to disable browsing. To resolve that, just navigate to that web site in IIS, find Directory Browsing icon, and press Enable. You will at least see the files inside that directory.
Also try not only 127.0.0.1:81, buta specific document inside that folder, like 127.0.0.1:81/Default.aspx
Take into account the fact that there's sometimes some mess with the ports. You see that in the error message it's port 82, but in your browser it's port 81. So make sure you're using the right port. Or, even better, in your service definition try to use some non-standard port for this to avoid remapping.
I've met the same issue. In the end, I had to reinstall IIS 7.
I got this exact same error and tried a re-install of IIS and the Azure SDK - nothing worked.
Eventually tracked it down to the "IIS URL Rewrite Module 2". I went to the Control Panel and chose Repair and it resolved it. If you have a section in your web.config then this might be the cause.
Follow step 11 from http://www.microsoft.com/en-us/download/details.aspx?id=35448. Worked for me on Windows 8 with Oct 2012 SDk when upgraded from 2011.

Resources