2014-01-07 4 views
2

도움말 페이지가 원활하게 실행되는이 ASP.NET webapi 프로그램이 있습니다.면도기 엔진이 분명히있을 때 Index.cshtml 페이지를 찾을 수 없습니다.

어딘가에 뭔가가 발생했고 도움말 페이지가 더 이상로드되지 않습니다.

The view 'Index' or its master was not found or no view engine supports the searched locations. The following locations were searched: 
~/Areas/HelpPage/Views/Help/Index.aspx 
~/Areas/HelpPage/Views/Help/Index.ascx 
~/Areas/HelpPage/Views/Shared/Index.aspx 
~/Areas/HelpPage/Views/Shared/Index.ascx 
~/Views/Help/Index.aspx 
~/Views/Help/Index.ascx 
~/Views/Shared/Index.aspx 
~/Views/Shared/Index.ascx 
~/Areas/HelpPage/Views/Help/Index.cshtml 
~/Areas/HelpPage/Views/Help/Index.vbhtml 
~/Areas/HelpPage/Views/Shared/Index.cshtml 
~/Areas/HelpPage/Views/Shared/Index.vbhtml 
~/Views/Help/Index.cshtml 
~/Views/Help/Index.vbhtml 
~/Views/Shared/Index.cshtml 
~/Views/Shared/Index.vbhtml 



Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.InvalidOperationException: The view 'Index' or its master was not found or no view engine supports the searched locations. The following locations were searched: 

public ActionResult Index() 
    { 
     ViewBag.DocumentationProvider = Configuration.Services.GetDocumentationProvider(); 
     return View(Configuration.Services.GetApiExplorer().ApiDescriptions); 
    } 

public class WebApiApplication : System.Web.HttpApplication 
    { 
     protected void Application_Start() 
     { 
      AreaRegistration.RegisterAllAreas(); 
      WebApiConfig.Register(GlobalConfiguration.Configuration); 
      FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); 
      RouteConfig.RegisterRoutes(RouteTable.Routes); 
      BundleConfig.RegisterBundles(BundleTable.Bundles); 
     } 
    } 

올바른 파일이 "~/지역/HelpPage/조회수/도움말/Index.cshtml"내부에 분명히 존재하고 나는 WebAPI 다음과 같은 모든 분야를 등록 지도 시간. 뷰 엔진은 알 수없는 이유로 도움말을 찾을 수 없습니다.

편집 :

괜찮 았어. ActionResult를 마우스 오른쪽 버튼으로 클릭하고보기로 이동하면 오류가 발생하여 아무 것도하지 않습니다.

그래서, 내가 바로 ActionResult를 클릭하고보기를 추가는 ~에서 새보기를지지합니다/뷰/도움말/Index.cshtml

그래서 어떻게든지해서 그 행동이 올바른보기 페이지로 연결되지 않으며, 내가 가진 그걸 어떻게 수정해야할지 모르겠다.

+0

다른 면도기보기가 작동합니까? 도움말 페이지일까요? – Vadim

+0

당신은 어떤 aspx보기가 발로 걷고 있습니까? – spender

+0

그냥 작동하지 않는 집안일, 집 하나가 작동하며, – noobiehacker

답변

0

두 루트에 HelpController이 있고 HelpPage 영역에 있기 때문에보기 엔진이 어느 것을 표시할지 파악할 수 없습니다.

, AppStart 아래 RouteConfig.cs 파일을 열고 기본 경로 설정에

routes.MapRoute(
      name: "Default", 
      url: "{controller}/{action}/{id}", 
      defaults: new { 
       controller = "Home", 
       action = "Index", 
       id = UrlParameter.Optional 
      }, 
      namespaces: new[] { "yourrootcontrollernamespace" } 
     ); 

체크 아웃 나는 오류 발견이 YouTube 동영상

1

을 다음과 같이 루트 컨트롤러 클래스의 네임 스페이스를 추가하십시오 폴더 영역이 루트 디렉토리에 있어야 할 때 실수로 잘못된 디렉토리에 놓였습니다