我正在尝试启动测试,但收到此错误
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/