.Net 4.0 System.Web.Security.MembershipProvider 引用不明确?

发布于 2024-09-19 04:59:15 字数 465 浏览 4 评论 0原文

我最近将 BlogEngine.Net 安装升级到 1.6 和 .Net 4.0,但是,在执行升级时我没有构建 BlogEngine.Core。但是,当我现在尝试构建 BlogEngine.Core 项目时,编译失败,因为它无法加载 (System.Web.Security.)MembershipProvider 的符号。我认为这是 .Net/C#/user 问题,而不是 BlogEngine 问题。

该项目引用了System.Web 库,并且类文件(继承自MembershipProvider)包含一个Using for System.Web.Security。启用 ReSharper 后,IntelliSense 会指示使用哪个成员资格提供程序的混乱,并提供两个同名的库 (System.Web.Security) 的选择。

是什么导致了这种含糊不清的引用?如何确定正在引用哪两个库?没有任何明显的迹象表明重复的引用。话又说回来,一旦你看到它,显而易见的事情就真的很明显了。

I have recently upgraded my BlogEngine.Net installation to 1.6 and .Net 4.0, however, I did not build BlogEngine.Core when I performed the upgrade. However, when I try to build the BlogEngine.Core project now, the compile fails because it cannot load the symbols for (System.Web.Security.)MembershipProvider. I believe this to be a .Net/C#/user problem rather than a BlogEngine issue.

The project has a reference to the library System.Web, and the class file (which inherits from MembershipProvider) includes a Using for System.Web.Security. With ReSharper enabled, IntelliSense indicates confusion as to which membership provider to use giving a choice of two libraries of the same name (System.Web.Security).

What could have caused this ambiguous reference? How can I determine which two libraries are being referenced? Nothing obvious indicates a duplicate reference. Then again, the obvious is really obvious once you see it.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

尬尬 2024-09-26 04:59:15

问题解决了。 System.Web.Security 命名空间是 System.Web 的成员,但它也是 System.Web.ApplicationServices 的成员。该项目引用了 System.Web,并且 using 语句引用了 System.Web.Security,因此 IntelliSense 在指定类时不会抛出标志。但是,该项目缺少对 System.Web.ApplicationServices 的引用。该项目引用了该类,但无法加载该类,因为缺少包含的程序集 (...ApplicationServices)。

Problem solved. System.Web.Security namespace is a member of System.Web, however, it is also a member of System.Web.ApplicationServices. The project had a reference to System.Web, and a using statement referenced System.Web.Security, so IntelliSense did not throw a flag when specifying the class. However, the project was missing a reference to to System.Web.ApplicationServices. The project had a reference to the class, but it could not load the class because the containing assembly (...ApplicationServices) was missing.

幽蝶幻影 2024-09-26 04:59:15

在为我的网络应用程序创建自定义会员资格提供程序时,我刚刚处理了同样的问题。您需要删除对 System.Web 的引用并添加以下引用。
- 系统.Web.ApplicationServices
- 系统配置

I just dealt with this same issue when creating a custom membership provider for my web application. You need to remove the reference to System.Web and add the following references.
- System.Web.ApplicationServices
- System.Configuration

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文