小编san*_*nvj的帖子

_AppStart.cshtml中的当前上下文错误中不存在"WebSecurity"

我收到以下编译错误:

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进行任何更改.

asp.net razor asp.net-mvc-4

1
推荐指数
1
解决办法
6099
查看次数

标签 统计

asp.net ×1

asp.net-mvc-4 ×1

razor ×1