Repercussions of enabling useLegacyV2RuntimeActivationPolicy?

守給你的承諾、 提交于 2019-12-06 18:40:41

问题


For my current project, we're using some CLR 2 based mixed mode assemblies.

In order to use these from within a .NET 4 targetted assembly, I know you have to add useLegacyV2RuntimeActivationPolicy=true to the <startup> element within app.config.

I understand that this changes the activation policy, causing these mixed-mode assemblies to be loaded using the highest supported version of the CLR.

However, are there any side effects to doing this? What potential issues should I watch for when enabling the non-default activation policy?


回答1:


Well, sure, you'll be running the app with a CLR version it has never been tested against. Microsoft does a great job keeping it backwards compatible. But the case of Microsoft managers losing email access for a few days after a .NET upgrade is famous. The threadpool timing was slightly different, exposing a threading race in a program written by an intern. Can't google the link right now.




回答2:


Hans Passant is partially correct. I attempt to explain this enigmatic attribute in this blog entry: http://www.marklio.com/marklio/PermaLink,guid,ecc34c3c-be44-4422-86b7-900900e451f9.aspx

The repercussions are essentially that you lock out in-proc SxS with pre-v4 runtimes. This is typically acceptable in a migration scenario.



来源:https://stackoverflow.com/questions/2256016/repercussions-of-enabling-uselegacyv2runtimeactivationpolicy

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