开发者

Is .NET supporting changes on a running desktop app?

I'm wondering if there is something like Hotswap/HotDelpoy/JRebel (known from Java World) in .NET Desktop Applications (no stateless webapps)?

As an example you change a functionality in the IDE while the Program is Running and the changes are instantly reflected in the running app

Do .NET Programmer need to restart the app on every chan开发者_开发百科ge to validate it?


No, when you hit a break point you are free to modify the code. When you continue the code will be re-compiled.

I believe that the marketing term for this is "Edit and Continue" (and of course only applies to Visual Studio).


As others have mentioned, the feature you are likely looking for is "Edit and Continue". It was added in VS2005 and has been supported since, however there are some scenarios where it won't work:

  • Can't use it to debug 64-bit applications
  • Can't edit & continue with changes to classes that have generic parameters
  • Can't edit & continue with changes to methods that have anonymous methods or lambda expressions within them
  • Probably a couple other cases


Look at the System.AddIn namespace.

Or, for updating an entire app, ClickOnce deployment.

Edit...

Hmm... re-reading and it sounds like you're talking about while still debugging. In that case, it's called "Edit and Continue".


You can do something similar to a hotswap or upgrade if your desktop application sets up multiple application domains (see System.AppDomain). Then each application domain can be hotswaped or upgraded without requiring a restart of your application. However, you will have to unload and load the AppDomain again.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜