Here is the code im using:
public string getDomainNames()
{
K2Manager myK2Mgr=new K2Manager();
StringBuilder strDomainNames=new StringBuilder();
int count=0;
try
{
Domains myDomains=myK2Mgr.GetDomains();
count=myDomains.Count;
foreach(Domain myDomain in myDomains)
{
strDomainNames.Append(myDomain.Name);
strDomainNames.Append('|');
}
return strDomainNames.ToString()+" "+count;
}
catch(Exception ex)
{
ex.ToString();
return ex.Message+" "+count;
}
}
myDomains.Count property returns the exception obj ref not set
Im running a development machine which has k2 studio and k2service manager installed in it (k2.net 2003 SP 3).
My machine connects to a domain server in which ADS is installed and it is configured as my k2server.
I studied the Help doc and searched for the K2server.config file it has the following tags in my local machine.
<K2Server>
<Database/>
<LogDatabase/>
<DefaultSMTPServer/>
</K2Server>
whereas in my domain server/K2server it has appropriate values for all the tags.
the code given by me above, im using it in an asp.net web application, which is in my development machine. I have configured the virtualdirectory security settings as follows
allow iis to manage passwords==false
anonymous access == enabled
anonymous user account: An user account in ADS.
I get the myDomains object returning null reference.Hope someone Can help me solve my problem. Please explain whats happening and why i get this error.
thanks to you all