gpt4 book ai didi

Azure 移动服务 - 未找到 Bootstrap

转载 作者:行者123 更新时间:2023-12-03 04:34:18 24 4
gpt4 key购买 nike

我有一个 Azure 移动服务项目。当本地运行时一切正常,Application_Start() 方法被调用,该方法又调用我的 WebApiConfig.Register() 方法。

但是,当发布到实时 Azure 移动服务服务器时,Application_Start() 不会与 WebApiConfig.Register() 一起调用。

在服务器日志中,我有以下条目:

No bootstrapper found -- using default bootstrapper. A bootstrapper can be specified in one of two ways: Either by defining a public, static class with name 'WebApiConfig' having a public parameter-less member called 'Register', or using the 'IBootstrapper' attribute to define a public class with a default constructor.

为什么 Azure 移动服务未获取我的 BootStrapping WebApiConfig?

public static class WebApiConfig
{
public static void Register()
{
Trace.TraceInformation("Hello from WebApiConfig Register().");


// Use this class to set configuration options for your mobile service
ConfigOptions options = new ConfigOptions();

// Use this class to set WebAPI configuration options
HttpConfiguration config = ServiceConfig.Initialize(new ConfigBuilder(options));


// To display errors in the browser during development, uncomment the following
// line. Comment it out again when you deploy your service for production use.
// config.IncludeErrorDetailPolicy = IncludeErrorDetailPolicy.Always;


}
}

public class WebApiApplication : System.Web.HttpApplication
{
public WebApiApplication()
{
Trace.TraceInformation("Hello from WebApiApplication ctor!");
}

protected void Application_Start()
{
Trace.TraceInformation("Hello from Application_Start()");


//RouteConfig.RegisterRoutes(RouteTable.Routes);
WebApiConfig.Register();

var dataContext = new DataContext();
dataContext.Database.Initialize(false);
}
}

非常感谢您的帮助!

最佳答案

这太奇怪了...看起来你确实是对的。使用 .net 后端 azure 移动服务几周后,我可能建议在门户中重新启动该服务并重新发布。我和你一样遇到了一些奇怪的无法解释的东西,并且以某种方式修复了。

关于Azure 移动服务 - 未找到 Bootstrap ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29646150/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com