在MVC4服务栈 [英] Service Stack on MVC4

查看:109
本文介绍了在MVC4服务栈的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只是试图让服务栈一个mvc4项目下运行。是否与MVC 4.0 ServiceStack.Host.Mvc 的NuGet包的工作?我安装了它,并添加了 routes.IgnoreRoute(API / {*} PATHINFO); 来路由的配置,但是当我去没有找到的路线

/ API /元

和我得到的错误:


  

没有HTTP资源发现,请求URI相匹配
  。的http://本地主机:51681 / API /元



解决方案

找到了解决办法。每当我们正在创造新的asp.net mvc4项目它带有Asp.Net的Web API。并且还具有路径API /。我并不需要都在一起,所以才删除使用该模块的NuGet包管理器,它会像什么。

如果你还停留在任何地方让我知道。由于它是用asp.net mvc4现在为我工作。

I am just trying to get Service Stack running under a mvc4 project. Does the ServiceStack.Host.Mvc nuget package work with mvc 4.0 ? I installed it and added the routes.IgnoreRoute("api/{*pathInfo}"); to the routing config but it does not find the route when I go to

/api/metadata

and I get the error:

No HTTP resource was found that matches the request URI 'http://localhost:51681/api/metadata'.

解决方案

Found the solution. Whenever we are creating new asp.net mvc4 project it comes with Asp.Net Web Api. And that also having path api/. I don't you need both together, so just removed that modules using nuget package manager and it will work like anything.

If you still stuck anywhere let me know. As it is working now for me with asp.net mvc4.

这篇关于在MVC4服务栈的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆