Visual studio 2012 tf command not working in logged off state - visual-studio-2012

I'm using visual studio 2012 and tfs to do my development When I try to get the latest files using get command in tf.exe through batch in a logged off state, below error is shown.Where else running the batch manually in logged in state gets the latest file. Could anyone please help me on this regard. Thanks in advance
TF30063: You are not authorized to access
What I have tried:
I have tried to turn on alternate authentication credential also,
tried with correct -login:credentials

Update
You have to use an Active Directory account for on-premise TFS -- you can't directly provide a hotmail account.
According to the error info, you need to specific credentials with the command in the batch script.
Use /login option to specify credentials when running a command
Use the /login option to specify the Team Foundation Server user
account to run a command. This option can be useful when you are
working at the machine of another team member.
For example:
c:\code\SiteApp\Main\SolutionA\Project1>tf get program.cs /login:JuliaI,JuliaPassword

Related

Specified Port is already in use - Visual Studio 2019 when multiple users run the application in RDP server

Debugging ErrorI have a remote server that has a development environment with visual studio 2019 and TFS. When a user runs the dot net web application, the url assigned will be localhost:50179. At the same time if another user runs the same application it show the specified port is already in use as the current url is also same (localhost:50179). When I am using Local IIS(setting under Properties>web) there is no permission for the users other than administrator to create virtual directory. When I gave permission for the users , it says unable to start debugging as the server is not found with localhost.
So in short, Either I want to generate dynamic ports at run time without conflicting with multiple users or I want to run as Local IIS without error(Error attached as image). Please help. Thank you
I converted Web site to web application and also I gave full permission to users for IIS.
Please check if VS is running as administrator, if not, try running as administrator.

How do you permanently delete a folder inside an Azure VSTS project?

I have folders within both Azures VSTS (a TFVC repository) and TFS that I needed to permanently delete. On TFS this was quite easily done using the tf destroy $/<MyProject>/<Folder_To_Delete> command in a command window on the server on which the TFS is running. The web page in learn.microsoft.com that describes the "tf destroy" command (Https:// learn.microsoft.com/en-us/vsts/tfvc/destroy-command-team-foundation-version-control) shows that this command is also available for VSTS however I have been unable to get the command to work within a Developer Command Prompt window running on my local box.
tf destroy $/<MyProject>/<Folder_To_Delete> /collection:https://<MyTeamService>.visualstudio.com/<MyProject> /login:<userid>,<password>
The error I receive back is
TF31002: Unable to connect to this Team Foundation Server:
Team Foundation Server Url:
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 remote server returned an error: (404) Not Found.
However if I put the URL into a browser my VSTS instance shows up. So the 404 looks to me like azure is blocking outside efforts to permanently delete on VSTS. I have logged onto the Azure portal expecting to find something like the Advanced tools option you would find on Web App Services, But the Team Services / Team Projects has nothing like this. Can someone explain to me how to properly execute the "tf destroy" command on Azure Team Services? Or does Azures VSTS just lack the support to permanently delete individual folders and files?
The tf destroy command requires a collection URL. In VSTS, there is no concept of a collection, only team projects. All team projects are created under the Default Collection.
To use the tf destroy command with VSTS, your collection URL must be in the following format:
https://accountname.visualstudio.com/DefaultCollection
By putting a collection URL of https://accountname.visualstudio.com/Project Name, the command was looking for a collection called Project Name in the VSTS account, which does not exist.
This command works:
Open a Developer Command Prompt in administrator mode and issue the following command and supply your credentials.
tf destroy $/Project Name/Folder To Delete /collection:https://accountname.visualstudio.com/DefaultCollection
To Permanently destroy an item/folder in VSTS is also using Destroy Command (Team Foundation Version Control)
tf destroy [/keephistory] <itemspec1>[;<versionspec>][<itemspec2>...<itemspecN>]
[/stopat:<versionspec>] [/preview] [/startcleanup] [/noprompt] [/silent] [/login:username,[password]] [/collection:TeamProjectCollectionUrl]]
/collection which specifies the team project collection. However, in VSTS you only have one collection. There is no collection name like TFS in the url. And multiple collections under user voice:
Let us create multiple collections on Visual Studio Team Services
https://developercommunity.visualstudio.com/idea/365419/let-us-create-multiple-collections-on-visual-studi.html
So, when you specify /collection for VSTS in tf command line, you just need to enter https://xxx.visualstudio.com
Also pay attention to the /login:<userid>,<password>, you are using the wrong format, it should be /login:userid,[password], add a /preview for test first(When tf destroy runs in the preview mode, the files are not actually destroyed.)
Finally the result will be
When you remove the /preview and perform the really destroy, you will also get a prompt info:
Do you want to destroy $/Scrum/NugetTest/Capture1025.PNG and all of
its children? (Yes/No/All)
Select Yes to delete folder and files in it, All with all of its children.
https://<MyTeamService>.visualstudio.com/<MyProject> is the wrong URL. It should just be https://<MyTeamService>.visualstudio.com/.
The parameter is asking for a project collection, not a team project within the collection.

Unable to shelve changes in VS2012 for TFS2010

We are using TFS2010 (for source control only), and until recently everyone was using VS2010. Our developers just installed VS2012.
Pulling down code works fine in Visual Studio. When you go to "Pending Changes" in Team Explorer, we are seeing TF201072: A user or group could not be found. Verify that the users and groups used in your work item type definition have been added to Team Foundation Server., twice, at the top. We can still check-in code from VS - seems this error is ignored.
However, we are unable to shelve changes - when you attempt to shelve, the same error comes up in a popup, and the shelveset is not saved.
We can shelve using the command prompt (tf shelve), and can still shelve using VS2010, so it doesn't seem to be a permission issue. Also, the TFS administrator is not seeing the error message, and can shelve from VS2012 with no error.
Any thoughts as to what could be causing VS to error out here? We've tried clearing out the TFS cache, creating a new workspace, and gone over every option we could find in Visual Studio.
I had the same issue. Tried many different stuff from web sites and non of them helped. Finally find the solution for this. Follow these to make it work:
1) Create temporary AD User
2) You will need to transfer all old user configuration into a new temporary account. If you are OK with using the temporary account you may just keep it and get rid of old account. Go into the machine that TFS is installed and Run this command: TFSConfig identities /change /fromdomain:mydomain /todomain:mydomain /account:oldAccount /toaccount:temporaryAccount
(TFSConfig is in C:\Program Files\Microsoft Team Foundation Server XX.0\Tools\)
3) If you don't want to use temporary account you will need to convert from temp account to your old account. To do that run the same command wit changing the user names:
TFSConfig identities /change /fromdomain:mydomain /todomain:mydomain /account:temporaryAccount /toaccount:oldAccount
That's all you need to do.

Publishing vs2012 solution from TeamCity

I'm using Visual Studio 2012 and the publishing feature. I have created a publishing profile that deploys my application to a development server, and it works great when executed from vs2012 on my machine. Here is my problem; on the development server I also have TeamCity installed and I would like to trigger the publishing after a build have completed. So I created a simple build step that looks like this:
Build file path: .\src\Solution.sln
Targets: Rebuild
Command line parameters: /p:DeployOnBuild=true;PublishProfile=Ci
When this step is executing I get the following error:
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\Web\Microsoft.Web.Publishing.targets(4377, 5): error ERROR_USER_NOT_ADMIN: Web deployment task failed.
(Connected to 'dev.domain.com' using the Web Deployment Agent Service, but could not authorize. Make sure you are an administrator on 'dev.domain.com'.
The Ci profile contains a username and password that works when I run the publishing from Visual Studio on my machine. I have also tried passing in username and password as parameters in the build step, but I get the same result. Do I need to run the TeamCity services under admin accounts to get this working? All suggestions are appreciated.
I have just blogged about this at http://sedodream.com/2013/01/06/CommandLineWebProjectPublishing.aspx.
You are pretty close, hopefully I can close the gap.
You are correct that username and password are specified in the VS publish dialog, but we do not save the password in the .pubxml file. It is currently being saved in the .pubxml.user file, and that file is not used at all for command line scenarios. Because of that you will need to pass in the property. So in your case it should be
msbuild .\src\solution.sln /p:DeployOnBuild=true /p:PublishProfile=ci /p:Password=<insert-password>
If your web server does not have trusted certs you may need to also pass in /p:AllowUntrustedCertificate=true.
One little addition which may not be directly related to your issue, but may be helpful for others which may see this later.
If you are building the .csproj/.vbproj file (and potentially in some scenarios where the .sln file is used) you should pass in the property /p:VisualStudioVersion=11.0. More info on this available at my blog http://sedodream.com/2012/08/19/VisualStudioProjectCompatabilityAndVisualStudioVersion.aspx

CruiseControl.Net switch from console to service

I have set up a cruisecontrol.net build server. When running it in console mode it works fine, but when trying to run it as a windows service it doesn't work. The log file shows the following message:
ThoughtWorks.CruiseControl.Core.CruiseControlException:
Source control operation failed: No VSS database (srcsafe.ini) found.
Use the SSDIR environment variable or run netsetup.
The ssdir is set in ccnet.config, so what am I missing here?
Not sure if it's applicable but when I had problems switching between the Console version and the Service version it was down to access rights for the user I was starting the service as.
Perhaps the Service does not have access rights to the srcsafe.ini file and your account does(assuming that's what your using to run the console).
Apologies if I'm way off the mark, just trying to help!
I ran into similar issues when setting up our CI environment at work. If you can get log-in permissions for the service account you are using, you can log in as that account and run CC.NET via the console and debug your issues.

Resources