What other silent changes did happen from .Net Frameworkf v.4.0 to 4.5? [closed]

柔情痞子 提交于 2019-12-04 11:35:41

问题


We want to switch to .net 4.5 cause it offers many improvements.

But...sometimes I found some tricky details about not trivial changes in the framework.

Lets look for TPL unobserved exception handling as an eample:

If you do not wait on a task that propagates an exception, or access its Exception property, the exception is escalated according to the .NET exception policy when the task is garbage-collected. (note, there is no link or clarification for the term "exception policy")

Well, that is seemingly the behavior as it was in .Net v.4.0

But Stephen Toub tells us more:

To make it easier for developers to write asynchronous code based on Tasks, .NET 4.5 changes the default exception behavior for unobserved exceptions. While unobserved exceptions will still cause the UnobservedTaskException event to be raised (not doing so would be a breaking change), the process will not crash by default. Rather, the exception will end up getting eaten after the event is raised, regardless of whether an event handler observes the exception. This behavior can be configured, though. A new CLR configuration flag may be used to revert back to the crashing behavior of .NET 4.
Note that this change doesn’t mean developers should be careless about ignoring unhandled exceptions… it just means the runtime is a bit more forgiving than it used to be.

That is a great surprise. Taking into account there is no update in documentation.

So, I'd like to know what other "silent" changes I'd better know about happened in .Net v4.5
Please, share your knowledge.

P.S. Here word "silent" means the changes which hardly get known from Wat's New articles or even official documentation.


回答1:


The .NET Framework breaking change document calls this out (and more!).



来源:https://stackoverflow.com/questions/14424221/what-other-silent-changes-did-happen-from-net-frameworkf-v-4-0-to-4-5

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!