문제

I have a an ASP.NET MVC application that will need to access file resources on another machine, so I have shared the relevant directory and given a fresh domain user access to it. My question is: How do I get my ASP.NET MVC app to take on this new user's identity? Do I have to set this up separately when debugging and when deployed?

Thanks!

도움이 되었습니까?

해결책

<identity impersonate="true"
          userName="domain\user" 
          password="password" />

in your web.config should work. The other option (not recommended) is running your application pool as a user with the proper credentials.

다른 팁

MVC Still uses ASP.NET authentication so you should just need to use:

<identity impersonate="true"/>

In the web.config.

Are you running your MVC application within IIS? If so, set this user as the application pool identity. If not, you can use impersonation from within the web.config

http://msdn.microsoft.com/en-us/library/xh507fc5(v=vs.100).aspx

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top