简体   繁体   中英

User.IsInRole fails when using VS 2008's debugging web server on Windows 7 using Windows Auth

When the following line is called when running a website from the VS2008's web server i get a "The trust relationship between this workstation and the primary domain failed." exception.

if (User.IsInRole("SomeRole"))
...

I have turned UAC off, and set VS 2008, and it's built-in webserver, to run as an Administrator, and i have also rejoined my box to the domain. This code works fine if called from one of my Server 2003 boxes in IIS, and it always worked fine in Vista.

Any ideas on what may be causing this?

EDIT:

I just tried running it in IIS 7.5 on my local machine and i am getting the same error. Running it on Windows XP in IIS 5.1 and in the VS 2008 webserver works.

您是否尝试过以管理员身份运行VS2008?

This was a Win7/Server2008 R2 bug. The error only occurred when connected to a Windows 2000 domain.

Hotfix available from here

The built in web server is cassini, which is a rather limited web server. You may have discovered a feature cassini doesn't have-- maybe it can't do kerberos. Here is more discussion about what Cassini doesn't have .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM