ASP MVC 4.x版+:重新编译项目的每一次 - 如何解决? [英] ASP MVC 4.x+: Recompile project every time - how to fix?

查看:134
本文介绍了ASP MVC 4.x版+:重新编译项目的每一次 - 如何解决?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们必须转换为ASP MVC,这是越来越多越来越大的解决方案。

现在的问题是:
应用程序的启动大约需要15+秒,因为应用程序需要pre-缓存了很多东西从数据库中。

现在,在ASP MVC的问题是,我们每次在控制器改变一些东西的时候,整个应用程序被关闭并restartet,在Global.asax中所有的东西再次执行(如果应用程序来自作为冷启动

想象一下:你写一个简单的if条件,由你放错了意外的参数 - >您必须更正如果条件。
- >整个应用程序是restartet

因此​​,我们有我们每次改变哪怕是很小的事情等待的时间超过15秒。

在老ASP.NET,您放置大多code,其中刚刚重新间preTED的.aspx-文件,但整个应用程序没有关闭等。

有一个变通的呢?
像-lets称的 - 跨preTED控制器,而不是编控制器?

此ASP MVC行为使得它真的很烦人,目前的解决办法是把尽可能多的东西尽量到的意见,这是不好的做法 - 但嘿,它可以帮助我们,因为我们不必等到15+秒,直到控制器重新编译和应用程序重新启动。

任何想法?

问候


解决方案

一直是以Microsoft事件在几个星期前,重点是ASP vNext。

在之前的vNext ASP / MVC的版本中,它实际上是由设计

我们也讨论了这个问题。

在下一版本的ASP vNext,你可以在飞行中改变控制器code,而不需要重新编译整个项目(因此,preventing关闭整个Web服务器进程)

好消息 - 至少对未来; - )

we have a solution converted to ASP MVC, which is growing bigger and bigger.

The problem now is: The startup of the application takes around 15+ seconds, because the application needs to pre-cache a lot of stuff from a database.

Now, in ASP MVC the problem is, every time we change something in a controller, the whole app is shut down and restartet, all the stuff in global.asax is executed again (as if the app comes from a "cold start"

Imagine: You write a simple if-condition, by accident you put in the wrong parameters -> you have to correct the if-condition. --> the WHOLE app is restartet.

So, we have to wait 15+ seconds every time we change even small things.

In old ASP.NET, you placed most of the code in .aspx-files which were just re-interpreted, but the whole app wasn't shut down etc.

Is there a work around for this? Like -lets call it- "interpreted controllers" instead of compiled controllers?

This ASP MVC behaviours makes it really annoying, the current workaround is to put as much stuff as possible into the views, which is bad practice - but hey, it helps us since we don't have to wait 15+ seconds until the controller is recompiled and the app restarted.

Any idea?

Regards

解决方案

Have been on a Microsoft Event a couple of weeks ago, focus was ASP vNext.

We discussed also this behaviour: It is actually by design in versions of ASP/MVC prior to vNext.

In next version "ASP vNext", you can change controller code on the fly, without the need of recompiling the whole project (thus, preventing to shut down the whole webserver process)

Good news - at least for the future ;-)

这篇关于ASP MVC 4.x版+:重新编译项目的每一次 - 如何解决?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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