问题是我认为我的代码
全球的尽快。反恐精英
没有运行。我试着把断点放进去
Global.asax - Application_Start function
它停在那里(这意味着它正在工作),但当我在
全球的尽快。反恐精英
,它不会停止。
我已尝试添加
<%@ Application Language="C#" Inhertis="Global.asax"%>
在…内
全球的asax公司
但我得到的是
Could not load type 'Global.asax'
我该怎么办?
编辑:
全球的尽快。反恐精英:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Http;
using System.Web.Routing;
/// <summary>
/// Summary description for Global
/// </summary>
///
public class Global
{
public Global()
{
//
// TODO: Add constructor logic here
//
}
void Application_Start(object sender, EventArgs e)
{
RouteTable.Routes.MapHttpRoute(
name: "DefaultApi",
routeTemplate: "api/{controller}/{id}",
defaults: new { id = System.Web.Http.RouteParameter.Optional });
}
}
public class Global : System.Web.HttpApplication
{
public Global()
{
}
protected void Application_Start()
{
Trace.TraceInformation("In application start");
}
}