1

我正在使用服务堆栈,并且我需要在路由中包含句点,例如以指示版本号,例如 /Model/v1.0/Save

当我将服务部署到 IIS6 上时,它工作得很好,但是当我通过 Visual Studio 在本地运行它时,我得到一个找不到请求处理程序的错误。如果我删除期间,那么它的工作原理!

我查看了所有问题,并且有一个类似的问题, 当路径中存在周期时未找到 ServiceStack 处理程序, 但答案暗示它无法完成并且我已经看到它正在工作。其次,在答案中引用的链接中,服务堆栈休息测试似乎表明带有句点的版本号是有效路线?见这里 https://github.com/ServiceStack/ServiceStack/blob/master/tests/ServiceStack.ServiceHost.Tests/RestPathTests.cs#L210

请有人能给我一些指导!谢谢

4

1 回答 1

1

I just answered this similar question, and i think the same should apply in this case: Visual Studio Development Server (Cassini) does incorrect routing for dots.

If you create a file system Web site in Visual Studio 2010 and the Web site is in a folder that contains a dot (.) in the folder name, URL routing will not work reliably. An HTTP 404 error is returned from some virtual paths. This occurs because Visual Studio 2010 launches the Visual Studio Development Server (Cassini) using an incorrect path for the root virtual directory.

There are 3 workarounds, and only the "use IIS instead of Cassini" workaround seems to work for ServiceStack.

The problem will go away if you edit your project Web properties and check "Use IIS Express" instead of "Visual Studio Development Server".

The cases to use IIS Express are explained in the announcement, and there is a download link.

于 2013-09-14T21:57:04.763 回答