Servicestack razor page is added to content

I am trying to use Servicestack with F #. So far I am successful. But, trying to figure out asp.net hosting using a shaving engine. I am facing a strange problem.

If for default.cshtml I select a property that is not copied with compilation with content, than the page is not populated, and it goes to the metadata page. But if I tune in to copying, if a newer one it will work.

But as far as I know, this should not be copied, since compilation is content. If we do not, then for each change on the cshtml page, you must restart the project.

Now it is also unique to the F # project, in C # it works. So, I don’t know exactly where to look. BTW I am using servciestack version 3.9.71.

Please let me know if you need more information. My repo project

+4
source share
1 answer

Update:

Your application is not configured correctly.

Your F # MVC application is not configured correctly. You are using ASP.NET, which should use IIS as its host. This means that IIS requests are passed to AppHost. However, in your setup you use AppHostHttpListenerBase, it actually creates your own HTTP listener, in fact, you mixed standalone standalone hosting with the installed ASP.NET installation.

. , ServiceStack , .

:

type AppHost =
    inherit AppHostBase
    new() = { inherit AppHostBase("Hello F# Services", typeof<HelloService>.Assembly) }
    override this.Configure container =
    ...

, , MVC ASP.NET.

DebugMode = true, ServiceStack , .


, , , , FZ ASP.NET ServiceStack Razor, , , .

F #, #, AppHost DebugMode = true, ServiceStack , , , .

SetConfig(new EndpointHostConfig {
    DebugMode = true,
});

, :

type AppHost() = 
    inherit AppHostHttpListenerBase("Hello F# Service", typeof<HelloService>.Assembly)
    override this.Configure container =
        this.Plugins.Add(new RazorFormat()) 
        ignore()

    static member start() = 
        let apphost = new AppHost()
        apphost.Init()

. " , ( )" .

, , , ...

+4

All Articles