Giraffe.Razor icon indicating copy to clipboard operation
Giraffe.Razor copied to clipboard

Setting viewsFolderPath has no effect

Open toburger opened this issue 5 years ago • 2 comments
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:

image

toburger avatar Jul 08 '20 08:07 toburger

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?

dustinmoris avatar Jul 08 '20 22:07 dustinmoris

I've created a minimal repro based on the giraffe 1.0.0 template: https://github.com/toburger/giraffe-razor-custom-view-folder

toburger avatar Jul 09 '20 13:07 toburger