首页 > 其他 > 详细

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

时间:2016-01-25 21:09:05      阅读:205      评论: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
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!