Quantcast
Channel: Team Foundation Server - General forum
Viewing all 6687 articles
Browse latest View live

C# & TFS API to get the group members

$
0
0

Hi all,

I have created a console application which gives us all the groups of a team Project. I am able to retrieve all the TFS groups.

The code is :-

using Microsoft.TeamFoundation.Client;
using Microsoft.TeamFoundation.Framework.Client;
using Microsoft.TeamFoundation.Framework.Common;
using Microsoft.TeamFoundation.Server;
using Microsoft.TeamFoundation.VersionControl.Client;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ListGroupMember
{
    class Program
    {
       static void Main(string[] args)
        {
            Console.WriteLine("Enter TFS server or project collection Url");
            string servername = Console.ReadLine();
            Console.WriteLine("Enter Team Project Name");
            string TeamProjectName = Console.ReadLine();

            TfsTeamProjectCollection tfs = new TfsTeamProjectCollection(new Uri(servername));
            tfs.EnsureAuthenticated();

            //1.Get the Idenitity Management Service
            IIdentityManagementService ims = tfs.GetService<IIdentityManagementService>();
            
          
           //Find all the team projects in the collection and save in array of type ProjectInfo
            TfsTeamProjectCollection projCollection = TfsTeamProjectCollectionFactory.GetTeamProjectCollection(new Uri(servername));
            ICommonStructureService Iss = (ICommonStructureService)projCollection.GetService(typeof(ICommonStructureService));
            ProjectInfo[] ProjInfo = Iss.ListProjects();

           //Another way to get all team projects
            // Version control service exposes methods to work with TFS version control
            var vcs = tfs.GetService<VersionControlServer>();

            // Since we'll be reporting groups for all team projects, imp to get all team projects
            var teamProjects = vcs.GetAllTeamProjects(false);

           //Get all Application groups

            // Group Security service exposes methods to get groups, users and security details
            var sec = tfs.GetService<IGroupSecurityService>();
           // Store TFS Group name in an array of type string

            string[] tfsGroupName = { "Build Administrators", "Contributors", "Project Administrators", "Readers", "Endpoint Administrators","Endpoint Creators","Release Administrators" };
           foreach( var teamProject in teamProjects)
           {

               if (TeamProjectName == teamProject.Name)
               {
                    Identity[] appGroups = sec.ListApplicationGroups(teamProject.ArtifactUri.AbsoluteUri);
                  // Identity[] appGroups = sec.ListApplicationGroups("vstfs:///Classification/TeamProject/c339ff13-89db-4a33-977c-63988e4e645e");


            
                   //Get all members in application group

                    foreach (Identity group in appGroups)
                    {
                        if(tfsGroupName.Contains(group.AccountName))
                        {
                                  Identity[] groupMembers = sec.ReadIdentities(SearchFactor.Sid, new string[] { group.Sid }, QueryMembership.Expanded);
                          
                                    foreach (Identity member in groupMembers)
                                    {
                          

                                    }                    

                       }

                    }


               }
           }
            
        }   

         
    }
}

But I am unable to find the members of the group. How can I do this.

Please help. Thanks for assistance.


Import of WIT results in TF401349:Unexpected error has occured...

$
0
0

We are working on developing a customized WIT. We are getting this error when we export the WIT and then attempt to re-import the WIT unchanged. This WIT is a renamed copy of an out-of-the-box WIT from CMMI template.

This system was previously TFS2013U4 and has been upgraded to TFS2015U1 after the WIT was copied and renamed. The entire Error text is: 'TF401349: An unexpected error has occurred, please verify your request and try again.'

Can anyone please advise what the issue is?  

exploratory testing chrome

$
0
0

Good afternoon,

I'm trying to do exploratory testingconnecting me from the Chrome extension for tfs, downloaded from the page of visual studio

https://marketplace.visualstudio.com/items?itemName=ms.vss-exploratorytesting-web

And appeared the following error message:
Unable to connect to Team Foundation Server. Please check your connection.
I'm putting the same setup I had a few days ago where if I could connect.
I can not connect now at the exploratory testing.
I request help. Please.

Export TFS Query from Visual Studio to Excel ==> Problem TF80070

$
0
0

Hello,

when i try to export a TFS query in Visual Studio to Excel i get the Error TF80070.

I placed a config file in the excel Folder to get some detailed Information:

EXCEL.EXE Error: 0 : [Error, PID 15868, TID 13960, 2016/07/20 07:04:32.962, 1630 ms, General]
{
Exception:  {
Exception Message: Page not found. (type VssServiceResponseException)
Exception Stack Trace:    bei Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.HandleResponse(HttpResponseMessage response)
   bei Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.<SendAsync>d__79.MoveNext()
--- Ende der Stapelüberwachung vom vorhergehenden Ort, an dem die Ausnahme ausgelöst wurde ---
   bei System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   bei System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   bei Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.<SendAsync>d__76`1.MoveNext()
--- Ende der Stapelüberwachung vom vorhergehenden Ort, an dem die Ausnahme ausgelöst wurde ---
   bei System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   bei System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   bei Microsoft.VisualStudio.Services.Location.Client.LocationHttpClient.<GetConnectionDataAsync>d__6.MoveNext()
--- Ende der Stapelüberwachung vom vorhergehenden Ort, an dem die Ausnahme ausgelöst wurde ---
   bei System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   bei System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   bei Microsoft.VisualStudio.Services.Client.VssServerDataProvider.<ConnectAsync>d__39.MoveNext()
--- Ende der Stapelüberwachung vom vorhergehenden Ort, an dem die Ausnahme ausgelöst wurde ---
   bei System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   bei System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   bei Microsoft.VisualStudio.Services.Client.VssServerDataProvider.<EnsureConnectedAsync>d__37.MoveNext()
--- Ende der Stapelüberwachung vom vorhergehenden Ort, an dem die Ausnahme ausgelöst wurde ---
   bei System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   bei System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   bei Microsoft.VisualStudio.Services.Client.VssServerDataProvider.<GetInstanceIdAsync>d__9.MoveNext()
--- Ende der Stapelüberwachung vom vorhergehenden Ort, an dem die Ausnahme ausgelöst wurde ---
   bei System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   bei System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   bei Microsoft.VisualStudio.Services.Location.Client.LocationService.<GetLocationDataAsync>d__2.MoveNext()
--- Ende der Stapelüberwachung vom vorhergehenden Ort, an dem die Ausnahme ausgelöst wurde ---
   bei System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   bei System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   bei Microsoft.VisualStudio.Services.Client.VssConnection.<GetClientInstanceAsync>d__15.MoveNext()
--- Ende der Stapelüberwachung vom vorhergehenden Ort, an dem die Ausnahme ausgelöst wurde ---
   bei System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   bei System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   bei Microsoft.VisualStudio.Services.Client.VssConnection.GetClient(Type clientType, VssHttpRequestSettings settings)
   bei Microsoft.TeamFoundation.Client.TfsConnection.GetClient[T](VssHttpRequestSettings settings)
   bei Microsoft.TeamFoundation.WorkItemTracking.Client.Provision.ProvisionClass.BuildRestClient()
   bei Microsoft.TeamFoundation.WorkItemTracking.Client.WorkItemStore.ExportGlobalLists()
   bei Microsoft.TeamFoundation.OfficeIntegration.Client.ProjectHashCodeCalculator.CalculateHashCode(Project project)
   bei Microsoft.TeamFoundation.OfficeIntegration.Client.Common.OfficeProjectContext.CalculateHashCode()
   bei Microsoft.TeamFoundation.OfficeIntegration.Client.Common.OfficeProjectContext.Initialize()
   bei Microsoft.TeamFoundation.OfficeIntegration.Client.Common.OfficeProjectContext..ctor(NamespaceData namespaceData, String projectName, String projectUri, Guid projectId)
   bei Microsoft.TeamFoundation.OfficeIntegration.Client.ExcelAddIn.CreateDocumentInternal(String tfcNamespaceUrl, String tfcProject, String documentPath, String templateFile, QueryReference queryReference, Boolean bindToQuery)
 }
}
EXCEL.EXE Error: 0 : [Error, PID 15868, TID 13960, 2016/07/20 07:04:34.344, 3012 ms, General] UIHost.ShowMessageBox: result=OK caption='Microsoft Excel' text='TF80070: Team Foundation encountered an error while performing the operation. It is recommended that you save your work and restart the application.'

My colleagues can export the same query to excel without any problems.

Thanks Markus

I want to genearte a log file whether the build is successful or not

$
0
0

I created a solution is TFS and I am building it using TFS build. If i queue the build it get successful or unsuccessful. I want to generate a text file that will contain "Build Successful" or "Build Failed". Can you please let me know how I can do this?

Thank you for your help.


With warm regards , Javed

Issue with 'Windings' text showing in the banner menu

$
0
0
I'd love to send you a screen shot of this but my account has not been authorized yet 

TFS Upgrade warning - TF402629 - TFS 2013 Update 5 to TFS 2015 Update 2

$
0
0

Hi,

We upgraded TFS 2013 Update 5 to TFS 2015 Update 2:

I have the following questions and need your inputs:

1. I received the warning during project collections upgrade. will this break any of the TFS functionalities

[2016-07-11 19:12:40Z][Warning] TF402629: The database encountered an error while indexing long text field values for work items. While you may use the upgraded server, work item query results against long text fields may be incomplete. Work with your database administrator to fix the errors that are logged in the full-text crawl log. Then, resume the full-text index population by running the following command against the collection database: ALTER FULLTEXT INDEX ON WorkItemLongTexts RESUME POPULATION.

2. We installed and upgraded to TFS 2015 in the new hardware. After upgrade I see both old App server(Tfs2013.Update5) and new App Server(Tfs2015.Update2) in the App Tier in the Admin console



Please let us know your inputs.

Many thanks

Venkat


Venkatesan Nadimuthu

TFS 2013 – Issue: Stuck builds in Team Foundation Build with no build number

$
0
0

All of the builds are getting stuck in the queue, and the run time shows 0 seconds.

The build server is separate from the TFS server. It runs on Windows 7, and has been for the past year. There are no error in the Console on the build server or in TFS. 

My build agents say ready, and have the green arrow.

Had gone thru this issue shown for TFS 2012. but under site binding, I only have one item in the list.

https://nkdagility.com/tfs-2012-issue-stuck-builds-in-team-foundation-build-with-no-build-number/

After digging through the logs, I found the error below. But, it makes no sense since nothing has changes since yesterday, and everybody has the same problem.

Log Name:      Microsoft-Team Foundation Server-Build-Services/Operational
Source:        Microsoft-Team Foundation Server-Build-Services
Date:          7/19/2016 6:47:58 PM
Event ID:      424
Task Category: WorkflowManager
Level:         Error
Keywords:      Process,WorkflowManager,Controller
User:          xxxxxx\ocsbuild
Computer:      xxxxxx.com
Description:
Bulkhead - Controller: Failed to finalize build vstfs:///Build/Build/21088 due to an exception.
Exception Type: Microsoft.TeamFoundation.Build.Client.AccessDeniedException
Exception Message: TF215106: Access denied. OCS-MAIN\kjackson needs Update build information permissions for build definition OasisQA--MWF in team project AtlasProd to perform the action. For more information, contact the Team Foundation Server administrator.
Stack Trace:    at Microsoft.TeamFoundation.Client.Channels.TfsHttpClientBase.HandleReply(TfsClientOperation operation, TfsMessage message, Object[]& outputs)
   at Microsoft.TeamFoundation.Client.Channels.TfsHttpClientBase.Invoke(TfsClientOperation operation, Object[] parameters, TimeSpan timeout, Object[]& outputs)
   at Microsoft.TeamFoundation.Build.Client.BuildWebService4.UpdateBuildInformation(InformationChangeRequest[] changes)
   at Microsoft.TeamFoundation.Build.Client.InformationNodeConverters.BulkUpdateInformationNodes(BuildDetail build, List`1 requests)
   at Microsoft.TeamFoundation.Build.Client.BuildInformation.Save()
   at Microsoft.TeamFoundation.Build.Hosting.BuildControllerWorkflowManager.FlushBuild(IBuildDetail build, BuildStatus finalStatus)
   at Microsoft.TeamFoundation.Build.Hosting.BuildControllerWorkflowManager.OnInstanceCompleted(BuildWorkflowInstance instance, IDictionary`2 outputs, Exception terminationException)
Event Xml:<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event"><System><Provider Name="Microsoft-Team Foundation Server-Build-Services" Guid="{05C4BC36-E3E1-4B96-9E0F-EB9337634CEC}" /><EventID>424</EventID><Version>0</Version><Level>2</Level><Task>6</Task><Opcode>28</Opcode><Keywords>0x4000340000000000</Keywords><TimeCreated SystemTime="2016-07-19T23:47:58.232849200Z" /><EventRecordID>10953</EventRecordID><Correlation ActivityID="{BE60AAEE-7459-4B64-A940-33D7C32453E7}" /><Execution ProcessID="2416" ThreadID="4568" /><Channel>Microsoft-Team Foundation Server-Build-Services/Operational</Channel><Computer>Bulkhead.oncenter.com</Computer><Security UserID="S-1-5-21-815403929-376661218-1404200075-18411" /></System><EventData><Data Name="MachineId">vstfs:///Build/ServiceHost/124</Data><Data Name="ProcessId">vstfs:///Build/Controller/15</Data><Data Name="ProcessName">xxxxxx- Controller</Data><Data Name="BuildUri">vstfs:///Build/Build/21088</Data><Data Name="FaultType">Microsoft.TeamFoundation.Build.Client.AccessDeniedException</Data><Data Name="FaultMessage">TF215106: Access denied. OCS-MAIN\kjackson needs Update build information permissions for build definition OasisQA--MWF in team project AtlasProd to perform the action. For more information, contact the Team Foundation Server administrator.</Data><Data Name="FaultStackTrace">   at Microsoft.TeamFoundation.Client.Channels.TfsHttpClientBase.HandleReply(TfsClientOperation operation, TfsMessage message, Object[]&amp; outputs)
   at Microsoft.TeamFoundation.Client.Channels.TfsHttpClientBase.Invoke(TfsClientOperation operation, Object[] parameters, TimeSpan timeout, Object[]&amp; outputs)
   at Microsoft.TeamFoundation.Build.Client.BuildWebService4.UpdateBuildInformation(InformationChangeRequest[] changes)
   at Microsoft.TeamFoundation.Build.Client.InformationNodeConverters.BulkUpdateInformationNodes(BuildDetail build, List`1 requests)
   at Microsoft.TeamFoundation.Build.Client.BuildInformation.Save()
   at Microsoft.TeamFoundation.Build.Hosting.BuildControllerWorkflowManager.FlushBuild(IBuildDetail build, BuildStatus finalStatus)
   at Microsoft.TeamFoundation.Build.Hosting.BuildControllerWorkflowManager.OnInstanceCompleted(BuildWorkflowInstance instance, IDictionary`2 outputs, Exception terminationException)</Data></EventData></Event>



Uninstall

$
0
0
How do I uninstall Visual Studio. Got installed on my new home computer.

Bug: TF400030: The local data store is currently in use by another operation, with a single VS instance

$
0
0

VS 2015 Update 1 hangs for about a minute when opening a Solution source controlled in Visual Studio Team Services, marks all project files as checked out (while nothing is checked out) an shows the error "TF400030: The local data store is currently in use by another operation. Please wait and then try your operation again. If this error persists, restart the application." two times.

This even happens after a reboot and with exactly one VS instance running. Killing the VS process (sometimes several times) solves the problem.

Does anybody know a workaround?




Getting error through build agent TFS 2010.

$
0
0

Hi,

I've created a build definition to build a WPF project that includes many layers. It also has a VSTO project that is successfully built through msbuild argument /p:VisualStudioVersion=10.0

I've setup the build agent on a VM that has windows 7 and also has VS 2010 installed. It is a 32-bit machine. I'm using TFS 2010 build service to run this build definition. I get the below error, when I use the build agent on this VM:

Attempt by method 'Microsoft.TeamFoundation.Build.Workflow.Activities.TfUndo+TfUndoCore.RunCommand(Microsoft.TeamFoundation.Build.Workflow.Activities.VersionControlScope, Microsoft.TeamFoundation.VersionControl.Client.Workspace, System.String, System.String)' to access method 'Microsoft.TeamFoundation.VersionControl.Client.Workspace.Undo(Microsoft.TeamFoundation.VersionControl.Client.ItemSpec[], Boolean, Boolean, System.String[])' failed.

Any leads on this?

Please note that when I run the build through the build agent on my laptop which is windows 7, 64-bit machine with VS 2013, it works fine. The build controller is hosted both on my laptop and the TFS server.

Thanks in advance,

Pulkit

Unable to view work item using TFS web portal

$
0
0

Hello 

In one of our team project i am not able to see work items using TFS web portal when i click on the work bar it shows error as this feature can not be used until you configure it for this team project but when i click on the configure feature option it doesn't get configured and throws error as there are no process template with valid configuration settings for this team project. 

The interesting thing this is that one of the Project user (with contributor access) is able to view work items dashboard and other feature available under work bar without any error and for me as a TFS Administrator it show's those error. 

please see the screen shot below

 

We are currently using TFS 2015 Update 2.1, By the time this team project was created we were using TFS 2008. 

Kindly help what could be the reason of this ? 

Regards

Dushyant Padhya


TFS and SQL installation and configuration


SQL Server 2014 SP2 support TFS 2013 Update 4

$
0
0
Is SQL Server 2014 SP2 supported TFS 2013 Update 4?

Edit Test Case

$
0
0
I have been able to use the Bold, Italics and Underline in my test cases. Now it is not working anymore. Any idea what I need to do to get that working again?

Bug: C# syntax highlighting is incorrect in TFS for interpolated strings

$
0
0

I'm not sure if there's a dedicated page to report bugs. I looked around and couldn't find a place. I'm assuming I should report bugs on this forum?

Anyway, the syntax highlighting is incorrect for interpolated strings if they contain a quote inside of the string.

If I have a string like: 

var thing = $"Hello {GetThing("world")}";

it ends up looking like this in the PR or in the code explorer (it's a multi-line interpolated string):

...and it messes everything up that comes after it. 



Expand the test step module

$
0
0
I've been wondering why the "Steps" section/module is limited to showing only 3 steps at a time, this is after I expended the module to full page. It is quite annoying to be limited to that tiny space while there is plenty of empty/white spaces below! Please allow this module to be expended....Thanks!

TFS 2015 Alert API: Create an alert for Team or TFS Group

$
0
0

Is it possible to setup a Team Alert / TFS Group Alert Programmatically using TFS 2015 APIs or Power Shell script. We have a requirement to create TFS Alert more then ~15 and looking for an option to create using script instead of manually.



brijen



TFS unable to write data to the transport connection

$
0
0
I'm attempting to check in large files (~0.5GB)  to the TFS Team Services server from a Visual Studio 2012 client. After about a half-hour it consistently fails with the message, "Unable to write data to the transport connection: An existing connection was forcibly closed by the remote host." I am able to check in smaller files. Is there a current size limit on files checked into TFS?

New Work Item Button in Projects web Application toolbaritems is not working on the first click intermittently

$
0
0

Hi,

I have recently migrated my projects web application from SP 2010 to SP 2013 and have mapped my TFS Projects with my TFS. My TFS is running on 2013 update 4 and SharePoint is on 2013 and Content DB version is 15.0.4675.1000. We have Deployed in Test and Stage environments and noticing same behavior on both. Tried from Team Web Access and found no issues. I have removed Cache on all the share Point web front ends from the below path.

Path: C:\ProgramData\Microsoft\Team Foundation\Web Access

Also cleared cache from Team Foundation Server's App Tier in below Path

App Tier: C:\ProgramData\Microsoft\Team Foundation\Web Access

Service account of SP on TFS: C:\Users\<SP Farm Account>\AppData\Local\Microsoft\Team Foundation\5.0\Cache

Service Account of TFS on TFS app Tier: C:\Users\<TFS service account>\AppData\Local\Microsoft\Team Foundation\5.0\Cache

Could some one help me why I am not able to open a Work item from Projects application on first click intermittently but able to create/open the window when I double  click.

Let me know for more details and Thanks in Advance.


Thanks, Eshwar

Setting Git Security Programmatically

$
0
0

Hi,

we are currently trying to modify the security for Git in TFS programmatically.

So far we have tried these two ways :

1)

Microsoft.VisualStudio.Services.Security.Client

Method : SetAccessControlEntriesAsync

Note : This worked for TFS Permissions but for Git the behavior is weird.

When we run this command we see that ours security changes are applied but when we look in the web portal, nothing have changed :

"C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\TFSSecurity.exe"  /acl "Git Repositories" repositories/ee48ba66-240f-441a-859e-d4ed3c04748b  /collection:http://foo.net:8080/tfs/MyCollection

The Guid is the same, but the security shown are differents.

2)

Microsoft.TeamFoundation.VersionControl.Client.VersionControlServer
Method : SetPermissions

Note : This one does nothing.

Is it possible to modify Git Security in TFS programmatically? Or else automatise it via a powershell script?

If it's possible i'd like to have a code sample in C#.

Thank You!


Viewing all 6687 articles
Browse latest View live