Remoting - Network Service?Remoting - Network Service?
Old forum URL: forums.lhotka.net/forums/t/5195.aspx
ajj3085 posted on Tuesday, August 05, 2008
Hi,
I have a weird problem that pops up, and I don't know why. When my objects encounter a DataPortal error, they call an error handler which sends the error details to me.
Sometimes on the remoting server though, the email says it's from NT Authority\Network Service, and not the impersonated user. I don't know why this happens, but it makes it hard to figure out who to call when I get an error.
I'm reading the Csla.ApplicationContext.User property.. which usually has the proper value. The only thing that might affect the result is the fact that the email logger spaws its own thread to assembly and send the email.. but the thread should still have the impersonated user I would think.
Any ideas?
RockfordLhotka replied on Tuesday, August 05, 2008
The principal object is tied to the thread though, so if you spin up a new thread it probably won't have the correct principal. This is a .NET thing, and the solution is to figure out a way to pass the principal into the new thread so you can set that thread's principal.ajj3085 replied on Wednesday, August 06, 2008
Hmm, I guess I should look into that. That didn't occur to me, because it does usually work as I had expected, but I'll follow up along your suggestion.
Copyright (c) Marimer LLC