CCNet.Build.Common.ProjectDocument.GetProjectGuid C# (CSharp) Method

GetProjectGuid() public method

Gets unique project ID.
public GetProjectGuid ( ) : System.Guid
return System.Guid
		public Guid GetProjectGuid()
		{
			var node = SelectElement("/ms:Project/ms:PropertyGroup/ms:ProjectGuid");
			return new Guid(node.Value);
		}

Usage Example

		public override void CheckPage(TfsClient client)
		{
			base.CheckPage(client);

			var path = TfsPath;

			if (!CheckTfsPathArea(path, AreaName))
				throw new InvalidOperationException($"TFS path '{path}' seems not conforming with area name '{AreaName}'.");

			if (!CheckTfsPathProject(path, ProjectName))
				throw new InvalidOperationException($"TFS path '{path}' seems not conforming with project name '{ProjectName}'.");

			var project = new ProjectDocument(() => client.ReadFile(ProjectFile));

			ProjectUid = project.GetProjectGuid();
		}