我收到以下编译错误:
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
Run Code Online (Sandbox Code Playgroud)
我的项目正确引用"System.Web",而我使用"System.Web.Security"的其他文件编译正常.
当我将引用System.Web,System.Web.Pages和System.Web.Razor添加到我的应用程序时,问题就出现了.但我没有对WebMatrix.WebData或WebMatrix.Data进行任何更改.