質問

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