Unable to Login (PSI, C#, 2007)

O

Omri Swissa

Hi,
I have this code:
private static MyProjectServer2007_LoginWin.LoginWindows wsLoginWindows =
new MyProjectServer2007_LoginWin.LoginWindows();
private static MyProjectServer2007_Project.Project wsProject = new
MyProjectServer2007_Project.Project();

private void Login()
{
wsLoginWindows.Url =
@"http://localhost/MyProjectServer2007/_vti_bin/PSI/LoginWindows.asmx";
wsLoginWindows.Credentials = CredentialCache.DefaultCredentials;

if (wsLoginWindows.Login())
{
wsProject.Url = strBaseURL + CONST_Project;
wsProject.Credentials = CredentialCache.DefaultCredentials;

MyProjectServer2007_Project.ProjectDataSet dsProjectDataSet = new
MyProjectServer2007_Project.ProjectDataSet();

dsProjectDataSet =
wsProject.ReadProjectSet(MyProjectServer2007_Project.DataStoreEnum.WorkingStore);
}

}

Now in every add-in or exe that I have write it works.
But when I try to implement ProjectEventReceiver in a class library the
wsLoginWindows.Login() return False. Why? The code is no different, nothing
is changed exept that it's running on the server when event is occerd (public
override void OnPublishing(PSContextInfo contextInfo,
ProjectPrePublishEventArgs e)).

Thanks,
Omri
 

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