当我使用 Membership.GetUser()
方法并包含 using System.Web.Security;
命名空间时,错误显示
"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'. C:\Raj\Orchard\src\Orchard.Web\Modules\test\Controllers\VideoController.cs"
最佳答案
您需要在 Visual Studio 项目中的 System.Web.ApplicationServices 程序集中执行“添加引用”。请参阅以下链接了解更多信息:How to: Add or Remove References in Visual Studio
To add a reference in Visual C#
In Solution Explorer, right-click the project node and click Add Reference.
In the Add Reference dialog box, select the tab indicating the type of component you want to reference.
Select the components you want to reference, and then click OK.
关于c# - 使用 Membership.GetUser() 时发生错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10240834/