Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Hello -

 

I am using the User.Identity.Name to get the user that is logged into the pc. When I debug or run my ASP.Net application through Visual Studio this works as expected when I build an executable and install it on my pc it returns a blank value.

 

Any suggestions?

 

Thanks in advance!

 

Keri

Posted

Hi Keri,

I had similar problems, have you checked your web.config file. If this is not setup to allow authentication, you will not be able to pass the cookie in the session state, and this is where the user.identity.name gets its information from.

 

Have a look and if this is not the case, get back to me and I will try and help you some more

 

Ash

Posted

Yes, my authentication is set to

 

<authentication mode="Windows"/>

 

<authorization>

<allow users="*" /> <!-- Allow all users -->

 

</authorization>

 

Unless there is something else I need in web.config.

 

Thanks for your input!

 

Keri

Posted

I have found the problem....

 

Even though I turned off the Anonymous Access in the properties of the application before I did my build, when I install the application the anonymous access box is checked again. The anonymous access is found on the Directory Security tab of the application properties. I am not sure how this gets turned back on but it breaks my authentication code.

 

Keri

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...