.NET 3.5 runtime and .NET 4 runtime compatibility

故事扮演 提交于 2019-12-02 05:49:54

问题


Is it possible to run an application built on .NET 3.5 with a plug-in built with .NET 4?


回答1:


You will need to rebuild (not exactly true, check update) the .NET 3.5 application to target .NET 4.0 because by default it will start in the .NET 2.0 runtime which will then not support the plugin.

If the machine only has .NET 4.0 framework installed the application will not run unless rebuilt to target it specifically.

Update:

Well, you don't need to rebuilt after all. Chris comment got me thinking and I just tested with a console application built for .NET 3.5. You can just specify in its application configuration file the following block:

<startup>
  <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
</startup>

If this is present in the configuration the application will use the .NET 4.0 runtime.




回答2:


Yes/No. To run the 4.0 component you must be running in the context of the .NET 4.0 runtime. However, your 3.5 application can run in the 4.0 runtime.




回答3:


Please check the following links for answer.

HowToMakeVeriosnCompatible

DotNetVersions



来源:https://stackoverflow.com/questions/3187212/net-3-5-runtime-and-net-4-runtime-compatibility

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