Here's the situation:
I'm using WDS with an ASP.NET application. In order to make this work, I call the ExecuteQuery method inside a STA Thread.
While debugging, everything works fine.
When I deploy it, I get "Access Denied" in the ExecuteQuery method.
I printed out the current user name in several moments of the code and I found out that before calling the thread, the user is IUSR_xxxxx. But inside the thread, the user is ASP.NET.
I tried using impersonation in the web.config. Before the thread the user I set in the web.config file is impersonated, but when the thread starts, it changes back to ASP.NET
What can I do

No permission to use WDS!
hmayer
MaryV
Hello Themeros,
I'm not completely clear on what you're doing, but I can say that impersonation only works on the processing thread. If you are creating a new thread you need to save the security token from the original thread.
You might try referencing this documentaiton for additional information:
http://msdn.microsoft.com/library/default.asp url=/library/en-us/vsent7/html/vxconImpersonation.asp
Paul Nystrom - MSFT