R
Ram
I am trying to update some task names based on some information on
other columns. I need to do this when the project is published.
Though I have checkedout the project, I get CICOCheckedOutToOtherUser
error when I publish the project.
Am I doing somethin wrong?
public override void OnPublishing(PSLib.PSContextInfo contextInfo,
ProjectPrePublishEventArgs e)
{
try
{
prjGUID = e.ProjectGuid.ToString();
Guid sessionId = contextInfo.UserGuid;
ProjectWebSvc.Project project = new
ProjectWebSvc.Project();
project.Credentials =
CredentialCache.DefaultCredentials;
ProjectWebSvc.ProjectDataSet prjDataSet =
project.ReadProject(new System.Guid(prjGUID),
ProjectWebSvc.DataStoreEnum.PublishedStore);
prjDataSet = project.ReadProject(new
System.Guid(prjGUID), ProjectWebSvc.DataStoreEnum.WorkingStore);
foreach (ProjectWebSvc.ProjectDataSet.TaskRow t in
prjDataSet.Task)
{
t.TASK_NAME= "Test - " + t.TASK_NAME.ToString();
}
project.QueueUpdateProject(jobId, sessionId,
prjDataSet, false);
base.OnPublishing(contextInfo, e);
}
catch (SoapException ex)
{
//Log the error
}
}
other columns. I need to do this when the project is published.
Though I have checkedout the project, I get CICOCheckedOutToOtherUser
error when I publish the project.
Am I doing somethin wrong?
public override void OnPublishing(PSLib.PSContextInfo contextInfo,
ProjectPrePublishEventArgs e)
{
try
{
prjGUID = e.ProjectGuid.ToString();
Guid sessionId = contextInfo.UserGuid;
ProjectWebSvc.Project project = new
ProjectWebSvc.Project();
project.Credentials =
CredentialCache.DefaultCredentials;
ProjectWebSvc.ProjectDataSet prjDataSet =
project.ReadProject(new System.Guid(prjGUID),
ProjectWebSvc.DataStoreEnum.PublishedStore);
prjDataSet = project.ReadProject(new
System.Guid(prjGUID), ProjectWebSvc.DataStoreEnum.WorkingStore);
foreach (ProjectWebSvc.ProjectDataSet.TaskRow t in
prjDataSet.Task)
{
t.TASK_NAME= "Test - " + t.TASK_NAME.ToString();
}
project.QueueUpdateProject(jobId, sessionId,
prjDataSet, false);
base.OnPublishing(contextInfo, e);
}
catch (SoapException ex)
{
//Log the error
}
}