I want to get the username of the user using the application. So i want to use WindowsIdentity.GetCurrentUser() . Refer How do I get the current username in .NET using C#?
But the problem is the System.Security.Principal namespace does not give me any such class. In fact the namespace shows only the two interface and no classes. http://msdn.microsoft.com/en-us/library/System.Security.Principal(v=vs.110).aspx
I tried it on a server machine and on a local machine. Doesnt work.
Since that did not work i tried Environment.username. But Visual Studia cant find the property either. I opened the metadata file but no such property exists.http://msdn.microsoft.com/en-us/library/System.Environment(v=vs.100).aspx.
What am i doing wrong? FYI i'm working on a .net 4 silverlight application.
AfterThought: Is this because of silverlight?