F# ASP.NET Core project: EntryPointAttribute error

Viewed 893

This is my ASP.NET Core Web API entry-point:

open Microsoft.AspNetCore
open Microsoft.AspNetCore.Hosting

module Hosting =
    let BuildWebHost args =
        WebHost
            .CreateDefaultBuilder(args)
            .UseStartup<Startup>()
            .UseIISIntegration()
            .Build()

module Program =
    let [<EntryPoint>] main args = Hosting.BuildWebHost(args).Run(); 0

This is from Program.fs, the final file in my project.

After months of smooth compilation, I am suddenly getting the following compilation failure:

error FS0433: A function labeled with the 'EntryPointAttribute' attribute must be the last declaration in the last file in the compilation sequence.

It is the last declaration in the last file -- any idea why this might suddenly start failing now?

1 Answers
Related