.NET 4.0中System.Web.Security.MembershipProvider暧昧的参考?暧昧、System、NET、MembershipProvider

2023-09-04 22:40:02 作者:动情痞

我有我的BlogEngine.Net安装最近升级到1.6和.Net 4.0,但是,我没有建立BlogEngine.Core当我进行升级。然而,当我现在尝试建立BlogEngine.Core项目,编译失败,因为它无法加载(System.Web.Security中)的MembershipProvider的符号。我相信这是一个.net / C#/用​​户问题,而不是一个BlogEngine问题。

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.

该项目有一个参考图书馆的System.Web,类文件(它继承自的MembershipProvider)包括使用对System.Web.Security中。如果启用了ReSharper的,智能感知表明分不清哪些成员资格提供程序使用提供的两个同名的库(System.Web.Security中)的选择。

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.

推荐答案

问题解决了。 System.Web.Security命名空间是的System.Web的成员,但是,它也System.Web.ApplicationServices的成员。该项目有一个参考的System.Web,并using语句引用System.Web.Security中,让智能感知指定的类时,没有把一个标志。然而,该项目缺少一个参考,以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.