如何解决模拟错误/? [英] How Can I Resolve Impersonation Error/?

查看:150
本文介绍了如何解决模拟错误/?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的web.config文件中将模拟设置为true,并提供了具有管理员权限的用户名和密码。我为什么会收到此错误?



无法加载文件或程序集'Microsoft.CSharp,Version = 4.0.0.0,Culture = neutral,PublicKeyToken = b03f5f7f11d50a3a'或者它的依赖关系。未提供所需的模拟级别,或者提供的模拟级别无效。 (来自HRESULT的异常:0x80070542)

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)

推荐答案

当我尝试使用Windows应用程序使用模拟调用Web服务时遇到了同样的问题。 Windows应用程序是从Visual Studio启动的,起初我认为它会继承我的授权(因为我在代码中使用了我的管理员凭据);但它不会工作UNTIL我重新启动Visual Studio,以管理员身份运行它。修正了它。
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.


这篇关于如何解决模拟错误/?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆