简体   繁体   中英

Application start is not getting called in asp.Net application with Servicestack 4 and F#

I was trying asp.net host with servicestack application. Here is link to my repo

Without servicestack global.asax.fs 's application start is getting called but it is not getting called with servvicestak installed. I have successfully made it work with V3.71 and also with self host. But asp.net host with servicestack V4 it is breaking even before getting into application start. And error is coming that instance of AppHost is not created, so servicestack could not start. That is also making difficult to debug it.

Please have a look and at least provide a way to start debugging. Or a something I can start with to look into.

Please let me know if any further detail is required.

Just had a closer look at the source code, it's missing an ignore() statement and the end of Application_Start because the method is expected to return void (and apphost.Init() in v4 returns a ServiceStackHost so it can be chained), eg:

type Global() = 
    inherit System.Web.HttpApplication()
    member x.Application_Start (sender:Object, e:EventArgs) = 
        let apphost = new App_Start.AppHost()
        apphost.Init() 
        ignore()

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM