title: VB.Net - Adding WebApi 5 to Existing MVC 5 Site
body: <p>I have an existing VB MVC5 site and I am trying to add WebApi.</p>
  
  <p>I am following this tutorial: <a href="https://developerslogblog.wordpress.com/2016/12/30/adding-web-api-support-to-an-existing-asp-net-mvc-project/" rel="nofollow noreferrer">Adding Web API Support to an Existing ASP.NET MVC Project</a></p>
  
  <p>The tutorial examples use C# so I have been converting to VB.</p>
  
  <p>I am on step 2.2, adding the Global.asax configuration changes <strong>but I am getting the error:</strong> </p>
  
  <blockquote>
    <p>Argument not specified for parameter 'Config' of 'Public Sub Register(config As HttpConfiguration)'.</p>
  </blockquote>
  
  <p><strong>This is what I have for App_Start\WebApiConfig.vb:</strong></p>
  
  <pre><code>Imports System
  Imports System.Collections.Generic
  Imports System.Linq
  Imports System.Web
  Imports System.Web.Http
  
  Namespace myProjectName.App_Start
      Public Module WebApiConfig
          Public Sub Register(ByVal config As HttpConfiguration)
  
              ' Web API routes
              config.MapHttpAttributeRoutes()
  
              config.Routes.MapHttpRoute(
                  name:="DefaultApi",
                  routeTemplate:="api/{controller}/{action}/{id}",
                  defaults:=New With {.id = RouteParameter.Optional}
              )
          End Sub
      End Module
  End Namespace
  </code></pre>
  
  <p><strong>This is what I have for Global.asax.vb:</strong></p>
  
  <pre><code>Imports System
  Imports System.Web.Http
  Imports System.Web.Optimization
  Imports System.Web.Security
  Imports System.Web.SessionState
  Imports System.Collections.Generic
  Imports System.Linq
  Imports System.Web
  Imports System.Web.Mvc
  Imports System.Web.Routing
  Imports mySolutionName.myProjectName.App_Start
  
  Public Class MvcApplication
      Inherits System.Web.HttpApplication
  
      Protected Sub Application_Start()
          AreaRegistration.RegisterAllAreas()
          FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters)
          GlobalConfiguration.Configure(WebApiConfig.Register) '// &lt;-- Error here
          RouteConfig.RegisterRoutes(RouteTable.Routes)
          BundleConfig.RegisterBundles(BundleTable.Bundles)
      End Sub
  End Class
  </code></pre>