1

現在asp.netc#でWebサイトを作成しており、データベースでWindows Azureを使用しています。ファイルをサーバーにプッシュすると、完全に機能します。奇妙なことに、再生ボタンをクリックするたびにこのエラーが発生します。プレビューするためにサーバーに送信し続ける必要があるのは面倒なことになりました。誰かが私がこれを解決するのを手伝ってくれるなら、これは大いにありがたいです。また、私は「エリア登録」について読み、多くの方法を試みましたが、どれもうまくいかないようです。これは私のRouteConfig.csです

   public class RouteConfig
    {
    public static void RegisterRoutes(RouteCollection routes)
    {
        routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

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

URLを編集するとき:

   "{controller}/{action}/{id}"

そしてURLを入れてください:

  "Views/Home/{action}/{id}" 

ディレクトリが読み込まれるだけで、手動でファイルを選択できます。エラーは表示されませんが、インデックスにアクセスできません。[ビュー]をクリックすると、「localhost- / Views /」になりますが、ページは同じままです。[]をクリックします。もう一度"ビュー"と私は404"要求されたURL:/ Views /Views/"を取得します

これは私が受け取っているエラーです:

 Server Error in '/' Application.

The view 'Index' or its master was not found or no view engine supports the searched     
locations. The following locations were searched:
~/Views/Home/Index.aspx
~/Views/Home/Index.ascx
~/Views/Shared/Index.aspx
~/Views/Shared/Index.ascx
~/Views/Home/Index.cshtml
~/Views/Home/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:
~/Views/Home/Index.aspx
~/Views/Home/Index.ascx
~/Views/Shared/Index.aspx
~/Views/Shared/Index.ascx
~/Views/Home/Index.cshtml
~/Views/Home/Index.vbhtml
~/Views/Shared/Index.cshtml
~/Views/Shared/Index.vbhtml

Source Error: 

An unhandled exception was generated during the execution of the current web request.   
Information regarding the origin and location of the exception can be identified using   
the exception stack trace below.

Stack Trace: 


[InvalidOperationException: The view 'Index' or its master was not found or no view     
engine supports the searched locations. The following locations were searched:
~/Views/Home/Index.aspx
~/Views/Home/Index.ascx
~/Views/Shared/Index.aspx
~/Views/Shared/Index.ascx
~/Views/Home/Index.cshtml
~/Views/Home/Index.vbhtml
~/Views/Shared/Index.cshtml
~/Views/Shared/Index.vbhtml]
System.Web.Mvc.ViewResult.FindView(ControllerContext context) +355958
System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context) +121
System.Web.Mvc.ControllerActionInvoker.InvokeActionResult(ControllerContext    
controllerContext, ActionResult actionResult) +13
System.Web.Mvc.<>c__DisplayClass1a.<InvokeActionResultWithFilters>b__17() +23
System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter,    
ResultExecutingContext preContext, Func`1 continuation) +242
System.Web.Mvc.<>c__DisplayClass1c.<InvokeActionResultWithFilters>b__19() +21
System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext    
controllerContext, IList`1 filters, ActionResult actionResult) +177
System.Web.Mvc.Async.<>c__DisplayClass2a.<BeginInvokeAction>b__20() +89
System.Web.Mvc.Async.<>c__DisplayClass25.<BeginInvokeAction>b__22(IAsyncResult  
asyncResult) +102
System.Web.Mvc.Async.WrappedAsyncResult`1.End() +57
System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeAction(IAsyncResult  
asyncResult) +43
System.Web.Mvc.<>c__DisplayClass1d.<BeginExecuteCore>b__18(IAsyncResult asyncResult)  
+14
System.Web.Mvc.Async.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar) +23
System.Web.Mvc.Async.WrappedAsyncResult`1.End() +62
System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult) +57
System.Web.Mvc.Async.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar) +23
System.Web.Mvc.Async.WrappedAsyncResult`1.End() +62
System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult) +47
System.Web.Mvc.Controller.System.Web.Mvc.Async.IAsyncController.EndExecute(IAsyncResult 
asyncResult) +10
System.Web.Mvc.<>c__DisplayClass8.<BeginProcessRequest>b__3(IAsyncResult asyncResult) 
+25
System.Web.Mvc.Async.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar) +23
System.Web.Mvc.Async.WrappedAsyncResult`1.End() +62
System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +47
System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult 
result) +9
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()  
+9629296
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&  
completedSynchronously) +155

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET   
Version:4.0.30319.18034
4

2 に答える 2