I got confused in trying to implement my own basic viewing mechanism in F # at the moment. Essentially, I inherit from VirtualPathProviderViewEngine.
To do this, I need to set two views so that the engine knows where to look for submissions. In my F # class, I inherit the above and try to set two view layouts as shown below ...
type FSharpViewEngine() = inherit VirtualPathProviderViewEngine() let viewLocations = [| "~/Views/{1}/{0}.fshtml"; "~/Views/Shared/{0}.fshtml" |] member this.ViewLocationFormats = viewLocations member this.PartialViewLocationFormats = viewLocations
The code above omits the overrides required for VirtualPathProviderViewEngine. I run a project and I get an error message to say
The "ViewLocationFormats" property cannot be empty or empty.
I assume that I am incorrectly setting the two basic elements above. Am I simply assigning the above incorrectly or do you suspect that I am doing something else wrong?
As additional information, I added ViewEngine during startup in Global.fs (global.asax), for example ...
ViewEngines.Engines.Add(new FSharpViewEngine())
source share