Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting viewsFolderPath has no effect #17

Open
toburger opened this issue Jul 8, 2020 · 2 comments
Open

Setting viewsFolderPath has no effect #17

toburger opened this issue Jul 8, 2020 · 2 comments

Comments

@toburger
Copy link
Contributor

toburger commented Jul 8, 2020

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

@dustinmoris
Copy link
Member

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?

@toburger
Copy link
Contributor Author

toburger commented Jul 9, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants