Giraffe.Razor
Giraffe.Razor copied to clipboard
Setting viewsFolderPath has no effect
trafficstars
I want to set the Razor views path to something other than Views, but it seems that regardless of the path I am providing it always searches the default folders:
let sp = services.BuildServiceProvider()
let env = sp.GetService<IWebHostEnvironment>()
let viewsFolderPath = env.WebRootPath
services.AddRazorEngine(viewsFolderPath) |> ignore
The error message indicates that the newly registered views folder path wasn't registered:

Can you create a small repro?
Have you checked what the value is for env.WebRootPath? and in your file explorer if there is an index.cshtml file?
I've created a minimal repro based on the giraffe 1.0.0 template: https://github.com/toburger/giraffe-razor-custom-view-folder