vb.netbreezewebactivator

WebActivator error when converting Breeze js code to vb.net


After converting some breeze API from C# code to VB.NET, WebActivator throws Server Error in '/' Aplication when I run my project with the message:

The type DevCentralBreeze.HotTowelRouteConfig doesn't have a static method named RegisterHotTowelPreStart

I think I coded everything right - there is a static member, but WebActivator can't find it.

Does anyone know how I can get WebActivator to recognize this? Maybe some config issue?

Imports System.Web.Http

<Assembly: WebActivator.PreApplicationStartMethod(GetType(BreezeWebApiConfig),     "RegisterBreezePreStart")> 
Public Class BreezeWebApiConfig
  Public Shared Sub RegisterBreezePreStart()
    GlobalConfiguration.Configuration.Routes.MapHttpRoute(name:="BreezeApi", routeTemplate:="api/{controller}/{action}")
  End Sub
End Class

Solution

  • Looks like your error is not related to the piece of code that you've posted.

    The error refers to HotTowelRouteConfig class and missing RegisterHotTowelPreStart method. Your code shows BreezeWebApiConfig class with RegisterBreezePreStart (This is not the method you're looking for... ;-).