username

  • Thread starter Thread starter Eric Stott
  • Start date Start date
E

Eric Stott

I am calling some code that is running as a service and am getting a
NullReferenceException. I am wondering if this is the reason:
m_sUserID = System.Security.Principal.WindowsIdentity.GetCurrent.Name

Does this line of code work for service apps?

Thanks
 
Eric Stott said:
I am calling some code that is running as a service and am getting a
NullReferenceException. I am wondering if this is the reason:
m_sUserID = System.Security.Principal.WindowsIdentity.GetCurrent.Name

Does this line of code work for service apps?

Thanks
System.Security.Principal.WindowsIdentity.GetCurrent.Name shouldnt even compile, GetCurrent
is a method.
Make sure you rAppDomain PrincipalPolicy (see SetPrincipalPolicy) is set to
PrincipalPolicy.WindowsPrincipal.

Willy.
 

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

Back
Top