title: F# .NET Core 2.1 simple crud app: controllers don't get registered
body: <p>I am trying to use F# with .NET Core 2.1 to create a simple CRUD application but none of the controllers don't get registered. I see none of the controllers in Swagger and the controller themselves don't start.</p>
  
  <p>I appreciate any help or hint.</p>
  
  <p>Startup.fs</p>
  
  <pre><code>namespace SimpleCms
  
  type Startup private () =
      let mutable configuration : IConfigurationRoot = null
  
      member this.Configuration
          with get () = configuration
          and private set (value) = configuration &lt;- value
  
      new(env : IHostingEnvironment) as this =
          Startup()
          then 
              let builder =
                  ConfigurationBuilder()
                      .SetBasePath(env.ContentRootPath)
                      .AddJsonFile("appsettings.json", optional = false, reloadOnChange = true)
                      .AddJsonFile(sprintf "appsettings.%s.json" env.EnvironmentName, optional = true)
                      .AddEnvironmentVariables()
  
              this.Configuration &lt;- builder.Build()
  
      // This method gets called by the runtime. Use this method to add services to the container.
      member this.ConfigureServices(services : IServiceCollection) =
  
          services.AddLogging() |&gt; ignore
  
          services.AddSwaggerGen(fun x -&gt;
              x.SwaggerDoc("v1", new Info(Title = "SimpleCms", Version = "v1")) |&gt; ignore)
              |&gt; ignore
  
          services.AddMvcCore() |&gt; ignore
  
          services.AddMvc() |&gt; ignore
  
          let container =
              new Container(fun opt -&gt; 
  
              opt.Scan(fun x -&gt; 
                  x.AssemblyContainingType(typeof&lt;Startup&gt;)
                  x.Assembly("Dal")
                  x.Assembly("Logic")
                  x.WithDefaultConventions() |&gt; ignore)
  
              opt.For&lt;LiteDatabase&gt;().Use(new LiteDatabase("Filename=database.db")) |&gt; ignore
  
              opt.Populate(services) |&gt; ignore)
  
          container.GetInstance&lt;IServiceProvider&gt;()
  
      // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
      member this.Configure(app : IApplicationBuilder, env : IHostingEnvironment) =
          app.UseSwagger() |&gt; ignore
  
          app.UseSwaggerUI(fun x -&gt;
              x.SwaggerEndpoint("/swagger/v1/swagger.json", "My API V1") |&gt; ignore) |&gt; ignore
  
          app.UseMvc(fun x -&gt;
              x.MapRoute("default", "{controller=Home}/{action=Index}") |&gt; ignore) |&gt; ignore
  </code></pre>
  
  <p>HomeController.fs</p>
  
  <pre><code>namespace SimpleCms.Controllers
  
  open Microsoft.AspNetCore.Mvc
  
  [&lt;Route("")&gt;]
  type HomeController() =
      inherit Controller()
  
      [&lt;Route("")&gt;]
      [&lt;HttpGet&gt;]
      member this.Index() =
          Ok("Hello World!")
  </code></pre>
  
  <p>The complete code</p>
  
  <p><a href="https://github.com/amir734jj/fsharp-dotnet-core-mvc/tree/59eaaab7fb8e95f24aa44d7eb36c14988f3938a7" rel="noreferrer">Repo URL</a></p>