Webデプロイメントメソッドを使用して、Webアプリケーションをテストサーバーにデプロイします。アプリケーションは問題なく正常に構築され、ローカルとテストサーバーで正常に動作します。デプロイ中にプリコンパイルされた設定を使用したいときに問題が発生します。このプロセスの途中で、VerifyCode.cshtml
ファイルに大量のエラーがあります。私のビューフォルダにVerifyCode
というビューがありません。問題はどこだ?私は匿名とWindows認証を並行して使用しています。プリコンパイル済みビューを使用したwebappのデプロイ
例のエラー私は受け取って:
The name 'ViewBag' does not exist in the current context
The name 'Scripts' does not exist in the current context
The name 'Model' does not exist in the current context
'HtmlHelper' does not contain a definition for 'TextBoxFor' ...
のように...
VerifyCode.cshtml
コード:
@model App.Models.VerifyCodeViewModel
@{
ViewBag.Title = "Verify";
}
<h2>@ViewBag.Title.</h2>
@using (Html.BeginForm("VerifyCode", "Account", new { ReturnUrl = Model.ReturnUrl }, FormMethod.Post, new { @class = "form-horizontal", role = "form" })) {
@Html.AntiForgeryToken()
@Html.Hidden("provider", @Model.Provider)
@Html.Hidden("rememberMe", @Model.RememberMe)
<h4>Enter verification code</h4>
<hr />
@Html.ValidationSummary("", new { @class = "text-danger" })
<div class="form-group">
@Html.LabelFor(m => m.Code, new { @class = "col-md-2 control-label" })
<div class="col-md-10">
@Html.TextBoxFor(m => m.Code, new { @class = "form-control" })
</div>
</div>
<div class="form-group">
<div class="col-md-offset-2 col-md-10">
<div class="checkbox">
@Html.CheckBoxFor(m => m.RememberBrowser)
@Html.LabelFor(m => m.RememberBrowser)
</div>
</div>
</div>
<div class="form-group">
<div class="col-md-offset-2 col-md-10">
<input type="submit" class="btn btn-default" value="Submit" />
</div>
</div>
}
@section Scripts {
@Scripts.Render("~/bundles/jqueryval")
}