BACKGROUND


I have created a Silverlight / WCF based deployment tool that will be hosted in 2 places: the first will touch the development, testing, and staging servers, and the second will touch the production servers.

Inside the tool, it needs to know where it is so that it can show the appropriate environments and their servers for configuration.

The easiest way to do that is to pull the name of the account the WCF service is running under and based on that return the appropriate DeploymentMode value.


PROBLEM


My problem is that I can't get the name of the account the application pool is running under from within my WCF method. All I seem to pull from HttpContext.Current.User.Identity.Name is my own windows logon.

The application pools for both, the tool and the service, are running under a specific domain account, which is not mine.


QUESTION


How can I get the name of the account the application pool runs under inside of my WCF method?

有帮助吗?

解决方案

Use Environment.UserName in conjunction with Environment.UserDomainName to build the AppPool Identity Name.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top