参考自: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验证开启。