Hangfire and VB.NET - Gettings things configured in the Application Startup class

北慕城南 提交于 2019-12-01 23:45:11

You should be able to write that as:

Public Sub Configure(app As IAppBuilder)
    Dim act = Sub(config As IBootstrapperConfiguration)
                config.UseSqlServerStorage("<...>")
                config.UseServer()
              End Sub

    app.UseHangfire(act)
End Sub

For more on creating multi line lambdas in VB.Net, refer to the MSDN.

Ebassador

I must be doing something wrong. I too found Scott's blog post quite intriguing. I too use VB and was having trouble. The code @rfernandes shared was a welcome site. However, I get an error at run time.

Here's my code:

Public Sub Configuration(app As IAppBuilder)
    Dim act = Sub(config As IBootstrapperConfiguration)
                  config.UseSqlServerStorage("HangfireDb")
                  config.UseServer()
              End Sub

    app.UseHangfire(act)
End Sub

The error occurs in the config.UseSqlServerStorage("HangfireDb") call. An SqlException with the message "Column, parameter, or variable #5: Cannot find data type datetime2" is thrown. I'm not sure what to do about this one.

*** After posting this non-answer I realized that I needed to post a separate question. See this Stackoverflow question for the rest of the story.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!