Click here to Skip to main content
15,881,812 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
i have impersonation set to true in my web.config file and supplied the username and the password, which has admin rights. Why am i getting this error?

Could not load file or assembly 'Microsoft.CSharp, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. Either a required impersonation level was not provided, or the provided impersonation level is invalid. (Exception from HRESULT: 0x80070542)
Posted
Updated 16-Nov-17 10:44am
Comments
Kschuler 9-May-14 15:32pm    
Does the user that you are impersonating have the appropriate rights to whatever you're trying to access?
Member 10736689 19-May-14 12:25pm    
Yes it has full control

1 solution

I ran into this same problem, when trying to use a Windows app to call into a web-service using impersonation. The windows app was launched from Visual Studio, and at first I assumed it would "inherit" my authorization (since I was using my admin credentials in the code); but it would not work UNTIL I restarted Visual Studio, running it as Admin. That fixed it.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900