OnPublishing GeneralSessionInvalid error

W

Webdev2000

I am getting a GeneralSessionInvalid error when I try the below code on my
onpublishing event. When I use the same code in a seperate winform and do a
checkin / checkout using code (the lines which are commented) it works fine.
Please take a look at the code and let me know what I am doing incorrectly.
Thank you.


prjGUID = e.ProjectGuid.ToString();
Guid sessionId = contextInfo.UserGuid;
Guid jobId = Guid.NewGuid();



ProjectWebSvc.Project project = new ProjectWebSvc.Project();
project.Credentials = CredentialCache.DefaultCredentials;

ProjectWebSvc.ProjectDataSet ProjectList =
project.ReadProject(new System.Guid(prjGUID),
ProjectWebSvc.DataStoreEnum.WorkingStore);

ProjectList = project.ReadProject(new System.Guid(prjGUID),
ProjectWebSvc.DataStoreEnum.WorkingStore);
// project.CheckOutProject(new System.Guid(prjGUID),
sessionId, "My code checkout");
bool kk = false;
foreach (ProjectWebSvc.ProjectDataSet.TaskRow t in
ProjectList.Task)
{
//Logic to update some tasks
}
project.QueueUpdateProject(jobId, sessionId,
ProjectList, false);
jobId = Guid.NewGuid();
//project.QueueCheckInProject(jobId, new
System.Guid(prjGUID), false, sessionId, "code checked this project in...");
 
W

Webdev2000

One update...
If I use
project.Credentials = new NetworkCredential("Myusername", "Mypassword");
I get
GeneralSessionInvalid error but when I use
project.Credentials = CredentialCache.DefaultCredentials;
I get CICOCheckedOutToOtherUser error. I do know that this project is
checked out by me and I am the one publishing...Please help.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top