1

Resolved

Getting exception if perform check-in of assembly-info files is set to true

description

Getting exception if perform check-in of assembly-info files is set to true

on TFS Express 2012 on Windows 7 32-Bit

Overall Build Process

00:00
Update Build Number

00:12
Run On Agent (reserved build agent DTP168-B - Agent4)

00:00
Create Workspace

00:00
Get Workspace

00:02
Versioning Assemblies

00:00
AssemblyVersion and AssemblyFileVersion
Assembly Version Processing: Using version number patterns included in build definition

00:00
Set all Assembly Property Values (b)
Versioning assemblies with the following patterns: AssemblyVersion(1.0.B.0) and AssemblyFileVersion(1.0.B.0)
Checking out file for modification: C:\Builds\4\FxCop\TestCustomFxCopRuleSet\Sources\Properties\AssemblyInfo.cs
Updating version information in C:\Builds\4\FxCop\TestCustomFxCopRuleSet\Sources\Properties\AssemblyInfo.cs
Replacing AssemblyVersion in AssemblyInfo.cs with 1.0.88.0
Replacing AssemblyFileVersion in AssemblyInfo.cs with 1.0.88.0

00:00
GetBuildDetail

00:00
ReplaceAssemblyInfoProperties
Checking in pending changes
Exception Message: Access Denied: NETWORK SERVICE needs the following permission(s) to perform this action: Edit collection-level information (type AccessCheckException)

Exception Data Dictionary:

DISPLAYNAME = NETWORK SERVICE

TOKEN = 9863c313-4b6e-4c3b-88e2-af946c773f69

REQUESTEDPERMISSIONS = 2

NAMESPACEID = 5a27515b-ccd7-42c9-84f1-54c998f03866

DESCRIPTOR.IDENTIFIER = S-1-5-20

DESCRIPTOR.IDENTITYTYPE = System.Security.Principal.WindowsIdentity





Exception 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.VersionControl.Client.Repository5.CheckIn(String workspaceName, String ownerName, String[] serverItems, Changeset info, CheckinNotificationInfo checkinNotificationInfo, Int32 checkinOptions, Failure[]& conflicts, Failure[]& failures, Boolean deferCheckIn, Int32 checkInTicket, Int32 maxClientPathLength)

at Microsoft.TeamFoundation.VersionControl.Client.WebServiceLayer.CheckIn(String workspaceName, String ownerName, String[] serverItems, Changeset info, CheckinNotificationInfo checkinNotificationInfo, Int32 checkinOptions, UploadedBaselinesCollection uploadedBaselinesCollection, Failure[]& conflicts, Failure[]& failures, Boolean deferCheckIn, Int32 checkInTicket)

at Microsoft.TeamFoundation.VersionControl.Client.WebServiceLayerLocalWorkspaces.CheckIn(String workspaceName, String ownerName, String[] serverItems, Changeset info, CheckinNotificationInfo checkinNotificationInfo, Int32 checkinOptions, UploadedBaselinesCollection uploadedBaselinesCollection, Failure[]& conflicts, Failure[]& failures, Boolean deferCheckIn, Int32 checkInTicket)

at Microsoft.TeamFoundation.VersionControl.Client.Workspace.PagedCheckin(IEnumerable`1 changes, Boolean changesIsAllPendingChanges, Changeset changeset, CheckinNotificationInfo checkinNotificationInfo, CheckInOptions2 checkinOptions, UploadedBaselinesCollection uploadedBaselinesCollection, Failure[]& conflictsArray, Failure[]& failuresArray)

at Microsoft.TeamFoundation.VersionControl.Client.Workspace.CheckInInternal(WorkspaceCheckInParameters parameters, Int32 operationId)

at Microsoft.TeamFoundation.VersionControl.Client.Workspace.CheckIn(WorkspaceCheckInParameters checkinParameters)

at Microsoft.TeamFoundation.VersionControl.Client.Workspace.CheckIn(PendingChange[] changes, String author, String comment, CheckinNote checkinNote, WorkItemCheckinInfo[] workItemChanges, PolicyOverrideInfo policyOverride, CheckinOptions checkinOptions)

at TfsBuild.Versioning.Activities.CheckInFiles.Execute(CodeActivityContext context)

at System.Activities.CodeActivity.InternalExecute(ActivityInstance instance, ActivityExecutor executor, BookmarkManager bookmarkManager)

at System.Activities.ActivityInstance.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)

at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation)



Inner Exception Details:



Exception Message: Access Denied: NETWORK SERVICE needs the following permission(s) to perform this action: Edit collection-level information (type SoapException)SoapException Details: <detail xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><ExceptionProperties xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><property name="DisplayName"><value xsi:type="xsd:string">NETWORK SERVICE</value></property><property name="Token"><value xsi:type="xsd:string">9863c313-4b6e-4c3b-88e2-af946c773f69</value></property><property name="RequestedPermissions"><value xsi:type="xsd:int">2</value></property><property name="NamespaceId"><value xsi:type="d4p1:guid" xmlns:d4p1="http://microsoft.com/wsdl/types/">5a27515b-ccd7-42c9-84f1-54c998f03866</value></property><property name="Descriptor.Identifier"><value xsi:type="xsd:string">S-1-5-20</value></property><property name="Descriptor.IdentityType"><value xsi:type="xsd:string">System.Security.Principal.WindowsIdentity</value></property></ExceptionProperties></detail>

Exception Stack Trace:

file attachments

comments

tfs_bioanalytical wrote Jun 28, 2013 at 12:35 PM

Exception

justinpi wrote Jul 1, 2013 at 7:47 PM

The problem is that the checkin activity is passing a bogus, non-existent user name ("Versioning Build Process"). Since this user doesn't exist, it is trying to create the user, which requires collection-level admin permissions. Build service accounts don't have those by default. This auto-create behavior exists to support migration from VSS.

The correct thing to do is pass null, which will default the owner to the build service account and require no special permissions.

-Justin
Dev Lead - TFS Build Team

marknic wrote Jul 3, 2013 at 1:35 AM

This issue has been resolved based on Justin's input. The "author" field has been replaced with null to force the use of the current ID.

Thanks for the detailed input Justin,

Mark

wrote Apr 23, 2014 at 8:14 PM

denniswang wrote Apr 23, 2014 at 8:14 PM

For some reason, my work flow never fire the check in tasks even the "Perform Check-in on AssemblyInfo.cs" set to true.

I am using version 2.0.13183.5 and TFS version 2012.

chari wrote Mar 13, 2015 at 2:07 PM

Hi Justin,

I am having the same issue, and the work around is
"The "author" field has been replaced with null to force the use of the current ID". How to do this? Can you elaborate it?

Thanks,
Chari