是否有可能在动态.NET 4中创建的路线?有可能、路线、动态、NET

由网友(凉了时光疼了心)分享简介:在我们的应用中使用新的.NET 4的路由系统路由某些请求到网站的其他部分。我们只允许发布我们网站的code,在傍晚,这意味着我们必须熬夜工作发表任何code的变化。我们经常有必要创建定制的路线,以支持传统的链接,旧的内容,并将其路由到新的内容。这些通常需要马上和作为我们的路线是在编译Global.asax的定义,我们陷...

在我们的应用中使用新的.NET 4的路由系统路由某些请求到网站的其他部分。我们只允许发布我们网站的code,在傍晚,这意味着我们必须熬夜工作发表任何code的变化。我们经常有必要创建定制的路线,以支持传统的链接,旧的内容,并将其路由到新的内容。这些通常需要马上和作为我们的路线是在编译Global.asax的定义,我们陷入僵局的时候,我们需要立即将这些活,但不能做code推。

In our application we use the new .NET 4 routing system to route certain requests to other parts of the site. We are only allowed to publish our site code in late evenings which means we have to stay late at work to publish any code changes. We frequently have the need to create custom routes to support legacy links to old content and route them to the new content. These are often needed right away and as our routes are defined in compiled global.asax we reach an impasse when we need these live immediately but cannot do a code push.

有没有办法,我们可以在某种配置文件定义路由,并有现场看他们在编程,无需重新启动应用程序?一个方法

Is there a way that we could define routes in some sort of configuration file and have the site read them in programmatically without restarting the application?

推荐答案

菲尔哈克给出了动态注册途径解决此处的 http://haacked.com/archive/2010/01/17/editable-routes.aspx

Phil Haack gives a solution for dynamically registering routes here: http://haacked.com/archive/2010/01/17/editable-routes.aspx

我认为,涵盖了你想要的,包括不具有整个Web应用程序重新启动。

I think that covers what you want, including not having the whole Web App restart.

阅读全文

相关推荐

最新文章