Running a process as another user in ASP.NET
I have an ASP.NET MVC web application and in one of the controller actions I want to start a process (exe file). The process must run under a domain user because it accesses other resources in the domain. It can be either a single hard-coded user or a user who is currently on the web page. The web.config uses Windows Authentication.
I tried to enable impersonation and tried to turn impersonation when specifying a specific user. Both of these scenarios will cause permission issues.
I also tried to run the process as a specific domain / user / password, but that would give me the error "Login failed: unknown username or invalid password". I'm pretty sure the username / password is correct and the "runas" is working fine.
I'm not even sure about the correct way to do this. Any help is appreciated.
Thank.
The correct way is not to start the process from the web application. Use MSMQ in WCF instead .