我收到以下编译错误:
Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: CS0103: The name 'WebSecurity' does not exist in the current context
Source Error:
Line 1: @{
Line 2: if (!WebSecurity.Initialized)
Line 3: {
Line 4: WebSecurity.InitializeDatabaseConnection("AreaProject", "User", "UserId", "EmailAddress", autoCreateTables: true);
Source File: c:\Projects\area\trunk\dotNet\area.Web\area.Web\_AppStart.cshtml Line: 2
enter code here
我的项目正确引用了“System.Web”,而我使用“System.Web.Security”的其他文件正在编译。
当我将引用 System.Web、System.Web.Pages 和 System.Web.Razor 添加到我的应用程序时,问题就开始了。但我没有对 WebMatrix.WebData 或 WebMatrix.Data 进行任何更改。