You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tried to create a new Giraffe project via the manual steps.
To reproduce:
Create a new dotnet core console app in visual studio (dotnet core 3.1)
Add Giraffe NuGet (4.1.0)
Update Program.fs with:
module Firaffe
open System
open Microsoft.AspNetCore.Builder
open Microsoft.Extensions.Hosting
open Microsoft.Extensions.DependencyInjection
open Giraffe
let webApp =
choose [
route "/ping" >=> text "pong"
route "/" >=> htmlFile "/pages/index.html" ]
let configureApp (app : IApplicationBuilder) =
// Add Giraffe to the ASP.NET Core pipeline
app.UseGiraffe webApp
let configureServices (services : IServiceCollection) =
// Add Giraffe dependencies
services.AddGiraffe() |> ignore
[<EntryPoint>]
let main _ =
Host.CreateDefaultBuilder()
.ConfigureWebHostDefaults(
fun webHostBuilder ->
webHostBuilder
.Configure(configureApp)
.ConfigureServices(configureServices)
|> ignore)
.Build()
.Run()
0 // return an integer exit code
Trying to compile the code gives the "FS0039" error on line with .Configure(configureApp)
What did I miss to get this error?
The text was updated successfully, but these errors were encountered:
I had the same issue, it just turned out to be a missing dependency.
Dependencies should be:
open System
open Microsoft.AspNetCore.Builder
open Microsoft.AspNetCore.Hosting
open Microsoft.Extensions.Hosting
open Microsoft.Extensions.DependencyInjection
open Giraffe
This is for the second, functional startup example on README.
For the first example there are also missing dependencies (for logging and core hosting). These should be:
open System
open Microsoft.AspNetCore.Builder
open Microsoft.AspNetCore.Hosting
open Microsoft.Extensions.Hosting
open Microsoft.Extensions.Logging
open Microsoft.Extensions.DependencyInjection
open Giraffe
I tried to create a new Giraffe project via the manual steps.
To reproduce:
Trying to compile the code gives the "FS0039" error on line with
.Configure(configureApp)
What did I miss to get this error?
The text was updated successfully, but these errors were encountered: