-->

Setting up Web.config to work Side-by-Side with AS

2020-03-30 09:22发布

问题:

I checked out Run servicestack side by side with another web framework.

When I add the location tag the "api" is unresolved...what do I need to do to get the location tag to be aware of "api"?

回答1:

Firstly make sure you follow the README.txt instructions for running ServiceStack in ASP.NET MVC. ServiceStack automatically infers the handler path based on the <location> tag, if there's more than one or it has some other issue inferring, it can be explicitly set in Config.ServiceStackHandlerFactoryPath, e.g:

SetConfig(new EndpointHostConfig { 
    ServiceStackHandlerFactoryPath = "api",
});