asp.net - 运行测试时出错: "You must add a reference to assembly..."

标签 asp.net asp.net-mvc-3 compiler-errors

我正在尝试启动测试,但收到此错误

The type 'System.Web.Security.MembershipUser' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Web.ApplicationServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.

我在谷歌上查找,发现我必须将引用System.Web.ApplicationServices添加到我的项目中,我这样做了,但仍然不起作用。

我把它写在 web.config 中,但没有,我得到了同样的错误

  <assemblies>
 <add assembly="System.Web.ApplicationServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
      </assemblies>

有什么想法吗!!!谢谢。

最佳答案

什么时候遇到这个问题?在构建项目时,还是在实际运行测试时?

如果您在构建项目时得到它,请按照以下步骤查看是否可以解决您的问题:

1 - 在您的计算机中搜索此文件:“System.Web.Security.MembershipUser.dll”

2 - 找到它后,打开项目并选择“添加引用”菜单命令

3 - 选择您在步骤 1 中找到的文件

关于asp.net - 运行测试时出错: "You must add a reference to assembly...",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6780623/

相关文章:

asp.net - 在 MVC/ASP.NET 中发布包含列表的模型

c# - 使用 EF 更新 PK 时出错

asp.net - 如何更新 ASP.NET Web 应用程序?

html - 在特定情况下将两列彼此相邻定位

c# - ASP.NET MVC 全局错误处理

python - 无法在 Alpine Docker容器上安装pyorc

c# - ASP.NET MVC ActionFilterAttribute 在模型绑定(bind)之前注入(inject)值

asp.net-mvc-3 - MetadataType 缺少程序集引用

C++ vector 错误(Visual C++ 2008 Express Edition)

c++ - OpenSSL 在 x86 上编译失败,认为在 x86_64 上编译成功