使用不是管理员组成员的用户登录时无法加载文件或程序集“Microsoft.CSharp" [英] Could not load file or assembly 'Microsoft.CSharp' when logged in with user which is not a member of administrator group

查看:37
本文介绍了使用不是管理员组成员的用户登录时无法加载文件或程序集“Microsoft.CSharp"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个网站,当我使用管理员登录时,该网站编译成功,但是当我使用任何其他用户登录时,出现以下错误.

I have created a website which compiles successfully when I log-in using administrator but when I log-in using any other user, following error occurs.

无法加载文件或程序集Microsoft.CSharp,版本=4.0.0.0,Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' 或其中之一依赖关系.要么未提供所需的模拟级别,或者提供的模拟级别无效.(例外来自结果:0x80070542)

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)

管理员用户是

  • Acronis 远程用户
  • 管理员
  • 远程桌面用户

而另一个用户是其成员

  • Acronis 远程用户
  • 管理员 *
  • IIS_IUSRS
  • 远程桌面用户
  • SQLServerMSSQLUser$vm-tmp-abcd-1$MSSQLSERER
  • 用户

我正在使用
带有 64 位操作系统的 Windows Server 2008 R2 Enterprise

I am using
Windows Server 2008 R2 Enterprise with 64-bit Operating System

  • 最初其他用户不属于管理员组.我向其中添加了管理员角色,但仍然遇到相同的错误.
  • Initially the other user didn't belong to administrators group. I added the administrators role to it but still I am getting the same error.

注意:如果我选择 VS2010 以以管理员身份运行,它会成功编译网站.

NOTE: It compiles the website successfully if I choose VS2010 to run as administrator.

推荐答案

这个解决了我的问题.

  1. 右键单击 Visual Studio(无论您使用哪个版本)
  2. 属性
  3. 选择兼容性标签
  4. 填写以管理员身份运行此程序"复选框
  5. 从文件位置打开项目
  6. 运行应用程序

这篇关于使用不是管理员组成员的用户登录时无法加载文件或程序集“Microsoft.CSharp"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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