问题描述
我检查了 运行servicestack 与另一个 Web 框架并排.
当我添加位置标签时,api"无法解析……我需要做什么才能让位置标签知道api"?
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"?
推荐答案
首先确保您遵循 README.txt 说明 用于在 ASP.NET MVC 中运行 ServiceStack.ServiceStack 根据 标签自动推断处理程序路径,如果有多个或有其他问题推断,可以在
Config.ServiceStackHandlerFactoryPath
中明确设置>,例如:
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",
});
这篇关于将 Web.config 设置为与 ASP.NET MVC 4 并行工作 - 位置标签无法解析值“api"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!