码迷,mamicode.com
首页 > 其他好文 > 详细

VS 2008 迁移到 VS 2013 时出现 User.Identity.Name 为空的情况

时间:2016-01-25 21:10:16      阅读:227      评论:0      收藏:0      [点我收藏+]

标签:

参考自:http://stackoverflow.com/questions/19515890/authentication-issue-when-debugging-in-vs2013-iis-express/

user3149240的回答:

I had just upgraded to VS 2013 from VS 2012 and the current user identity (HttpContext.User.Identity) was coming through as anonymous.

I tried changing the IIS express applicationhost.config, no difference.

The solution was to look at the properties of the web project, hit F4 to get the project properties when you have the top level of the project selected. Do not right click on the project and select properties, this is something entirely different.

Change Anonymous Authentication to be Disabled and Windows Authentication to be Enabled.

Works like gravy :)

 

改IIS的config文件也不行,原因是Windows验证在vs2013中默认没有开启,我的问题解决方法是对Project点击属性(F4),然后disable 匿名验证,而把Windows验证开启。

VS 2008 迁移到 VS 2013 时出现 User.Identity.Name 为空的情况

标签:

原文地址:http://www.cnblogs.com/amble/p/5158628.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!