有没有类似 JRebel for .NET 的东西?

发布于 2024-09-14 12:46:42 字数 1539 浏览 16 评论 0原文

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

゛清羽墨安 2024-09-21 12:46:42

.net 世界里没有这样的东西.. 没有那么强大.. 有一些像编辑和继续这样的东西,但这就像 Java 中的“热替换”,仅此而已。
问题是在 .net 中,您拥有 .dll 的整个模型及其版本以及指向特定版本的 dll 之间的依赖关系,因此不可能在不替换全部的情况下替换 dll。

解决方法是编译类、添加大量程序集重定向、以某种方式卸载并加载旧的 dll,但这非常困难。

请记住,在 java 中实现“模块”JSR 后,也许在 java 9 中我们也不会再有 JRebel。

There is no such thing in the .net world.. not so powerful.. there are some thing like Edit and Continue but this is like "Hot replace" in Java and nothing more.
The problem is in .net you have the whole model of .dll(s) with their versions and dependencies between dlls pointing to specific version so it is not possible to replace dll without replacing all.

An workaround will be something like compiling the classes, adding tons of assembly redirects, somehow unloads and loads the old dll but it is hell of a hard.

Keep in mind that in java after the "module" JSR is implemented maybe in java 9 we will not have JRebel as well.

财迷小姐 2024-09-21 12:46:42

.Net 还没有这样的东西。同时,您可以尝试 NCrunch (http://www.ncrunch.net/),它正在运行您的测试在后台进行,当您中断或测试通过时,它会在测试结果中报告,因此您无需等待重建和测试执行,因为它是实时发生的。

There is not such thing for .Net yet. In the meantime, you can try NCrunch (http://www.ncrunch.net/), which is running your tests in the background and the moment you break or make a test pass it is reported in the test results, so you don't need to wait for rebuild and test execution as it is happening in real time.

夏末 2024-09-21 12:46:42

自 VS 2005 起就有一个内置功能,称为“编辑并继续”。您可以看一下... http://msdn .microsoft.com/en-us/library/ms379578(VS.80).aspx

我认为它不像 JRebel 那么复杂。

Well there is a build in feature since VS 2005 that is called "Edit and Continue". You might take a look... http://msdn.microsoft.com/en-us/library/ms379578(VS.80).aspx.

I think it is not that sofisticated as JRebel.

夜空下最亮的亮点 2024-09-21 12:46:42

反射内置于 .NET 中,并且应该能够执行大部分操作(在运行时编写/更改内容)。

它不会像 JRebel 那样完善和适合任务,但是这两个框架一开始就有不同的结构。将它们视为等同可能不太现实。

恕我直言,对我来说,运行时替换作为标准实践听起来是破坏运行时的好方法。如果您需要这种热插拔功能,也许您最好选择解释型语言而不是编译型语言。

此外,会话通常是需要避免的。如果必须将其用于 ASP.NET,则可以使用一些不同的开箱即用提供程序来代替进程内提供程序,甚至可以使用配置文件。
状态管理的 MSDN 页面

Reflection is built into .NET and should be able to do most of those things (writing/altering things at runtime).

It's not going to be as polished and task ready as JRebel, but then again the two frameworks have different structures to begin with. It may not be realistic to think of them as equivalents.

IMHO, runtime substitution as a standard practice sounds like a good way to corrupt the runtime to me. If you need this hot swapping functionality, perhaps you are better off choosing an interpreted language instead of a compiled one.

Also, session is usually something to avoid. If you have to use it for ASP.NET, you can use a few different out-of-the box providers instead of the in process one, or even use profiles instead.
MSDN page for state manangement

看海 2024-09-21 12:46:42

Rebel.NET 与此类似,但这需要重建二进制文件并且无法在执行期间更改代码。

There's Rebel.NET which is similar but this requires rebuilding the binaries and can't change code during execution.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文