2017-12-20 12 views
0

웹 배포 방법을 사용하여 웹 응용 프로그램을 테스트 서버에 배포하려고합니다. 응용 프로그램은 문제없이 정상적으로 빌드되며 로컬 및 테스트 서버에서 올바르게 작동합니다. 배포하는 동안 미리 컴파일 된 설정을 사용하려고 할 때 문제가 발생합니다. 이 과정의 중간에 나는 VerifyCode.cshtml 파일에 많은 오류가 있습니다. 내보기 폴더에 VerifyCode라는보기가 없다는 것입니다. 문제가 어디에 있습니까? 익명 및 Windows 인증을 병렬로 사용하고 있습니다.미리 컴파일 된 뷰를 사용하여 webapp 배포

게시 내 설정 : enter image description here enter image description here

예 오류 나는 receiveing ​​:

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") 
} 

답변

0

좋아, 나는 그것을 잘되게 만들었다. 문제는 사소했습니다. 어떻게 알았지 만 프로젝트에서 무작위로 VerifyCode이라는보기를 보았습니다.

재미있는 사실은 VS 검색 텍스트 도구가 찾을 수 없다는 것입니다. 예를 들어 약간의 연구를했습니다. here 그리고 VS에서 텍스트를 검색 할 때 몇 가지 문제가 있으며 항상 예상대로 작동하지 않는 것으로 나타났습니다.

그래서보기가 사전 컴파일 된 동안 모든보기 파일은 참조없이이 비열한 파일과 함께 긁혔습니다.