【问题标题】:ASP._Page_default_cshtml.Execute()': no suitable method found to overrideASP._Page_default_cshtml.Execute()':找不到合适的方法来覆盖
【发布时间】:2011-11-07 00:20:44
【问题描述】:

在尝试 Microsoft WebMatrix 日历模板 时,它可以在本地正常工作,但当我在主机服务器上尝试相同时,它不起作用并出现以下错误:

编译器错误消息: CS0115:“ASP._Page_default_cshtml.Execute()”:找不到合适的方法来覆盖

Line 41:         }
Line 42:         
Line 43:         public override void Execute() {
Line 44: 
Line 45:  

完整的编译源码为:

Line 1:    #pragma checksum "E:\web\nazmulwebco\htdocs\ical\default.cshtml" "{406ea660-64cf-4c82-b6f0-42d48172a799}" "91704A43AA481FE0EBCE348C223AE605"
Line 2:    //------------------------------------------------------------------------------
Line 3:    // <auto-generated>
Line 4:    //     This code was generated by a tool.
Line 5:    //     Runtime Version:4.0.30319.239
Line 6:    //
Line 7:    //     Changes to this file may cause incorrect behavior and will be lost if
Line 8:    //     the code is regenerated.
Line 9:    // </auto-generated>
Line 10:   //------------------------------------------------------------------------------
Line 11:   
Line 12:   namespace ASP {
Line 13:       using System;
Line 14:       using System.Collections.Generic;
Line 15:       using System.IO;
Line 16:       using System.Linq;
Line 17:       using System.Net;
Line 18:       using System.Web;
Line 19:       using System.Web.Helpers;
Line 20:       using System.Web.Security;
Line 21:       using System.Web.UI;
Line 22:       using System.Web.WebPages;
Line 23:       using System.Web.WebPages.Html;
Line 24:       using WebMatrix.Data;
Line 25:       using WebMatrix.WebData;
Line 26:       using Microsoft.Web.Helpers;
Line 27:       
Line 28:       
Line 29:       public class _Page_default_cshtml {
Line 30:           
Line 31:   #line hidden
Line 32:   
Line 33:           
Line 34:           public _Page_default_cshtml() {
Line 35:           }
Line 36:           
Line 37:           protected System.Web.HttpApplication ApplicationInstance {
Line 38:               get {
Line 39:                   return ((System.Web.HttpApplication)(Context.ApplicationInstance));
Line 40:               }
Line 41:           }
Line 42:           
Line 43:           public override void Execute() {
Line 44:   
Line 45:               
Line 46:               #line 1 "E:\web\nazmulwebco\htdocs\ical\default.cshtml"
Line 47:     
Line 48:       // Redirect to the initial main page
Line 49:       Response.Redirect("~/Calendar");
Line 50:   
Line 51:               
Line 52:               #line default
Line 53:               #line hidden
Line 54:   
Line 55:           }
Line 56:       }
Line 57:   }
Line 58:  

【问题讨论】:

    标签: razor webmatrix


    【解决方案1】:

    那不应该发生。你是通过 WebMatrix 部署的吗?它将验证您在 Web 服务器上配置了所有正确的功能,并确保部署了所有正确的文件。

    【讨论】:

    • 谢谢。是的,我通过 Webmatrix 部署。
    • 好吧,如果它在本地工作,但在您发布时不能工作,那么您部署到的服务器上可能配置错误。是共享主机还是你自己的服务器还是???
    • 我只想与他们确认他们已安装 .NET 4,并且他们运行您的网站的应用程序池设置为使用 .NET 4 集成。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-02-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多