如何避免MVC3中的剃须刀路径错误警告?
问题描述:
我的代码工作正常,但我得到很多的警告,如下列:如何避免MVC3中的剃须刀路径错误警告?
@model WebUx.Areas.Administration.ViewModels.Shared.BaseViewModel
@{
Layout = "~/Areas/Administration/Views/Accounts/_Layout.cshtml";
Session["CurrentUrl"] = Request.Url.ToString();
Session["CurrentHost"] = Request.Headers["Host"];
}
如何避免报警称警告
7
C:\Code J\T69 Dec 8\WebUx\Areas\Administration\Views\Accounts\ShowSummary.cshtml:
ASP.NET runtime error: Failed to map the path '/'.
C:\Code J\T69 Dec 8\WebUx\Areas\Administration\Views\Accounts\ShowSummary.cshtml
答
希望这个作品
Layout = @Url.Content("~/Areas/Administration/Views/Accounts/_Layout.cshtml");
你在IIS中托管你的应用程序? –