加载不同版本的同一总成

编程入门 行业动态 更新时间:2024-10-25 00:35:54
本文介绍了加载不同版本的同一总成的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

使用反射,我需要加载2不同版本的同一总成。我可以加载了2个版本的2个不同的AppDomain在同一个进程?

Using reflection, I need to load 2 different versions of the same assembly. Can I load the 2 versions in 2 different AppDomains in the same process?

我需要做一些数据迁移从旧版本的应用程序的新版本。 请让我知道这是可能的,或者我应该使用2个独立的进程。

I need to do some data migration from the old version of the app to the new version. Please let me know if this is possible or should I use 2 separate processes.

推荐答案

更新:我想我会后我发现作为一个答案。反思证明了开发工作而言过于复杂,跟踪当遇到类似的情况很长一段时间后,我记得做用2个不同的工艺不同的方式运行时错误等。(谢谢布兰登)。

UPDATE: I thought I will post my findings as an answer. Reflection proved too complex in terms of development effort, tracking run time errors etc. I remember doing a different approach using 2 different processes when faced with a similar situation long time back (Thank you Brandon).

这是该计划:没什么优雅,但在开发和故障排除方面更容易。由于它是一次性的工作,我们就必须使它发挥作用。

This is the plan: Nothing elegant but easier in terms of development and troubleshooting. Since it is a one time job, we just have to make it work.

主机远程处理过程(我称之为服务器),其应用程序的新版本。一个远程客户端的旧版本参考。

Host a remoting process (which i call the server) having the new version of the application. A remoting client has references for the older version.

远程客户端实例,并加载与迁移所需数据的对象。 转换旧的对象为普通序列化的对象,并作为参数传递给服务器。

Remoting client instantiates and loads the objects with data required for migration. Convert the old objects into common serializable objects and pass as parameters to the server.

远程服务器使用通用的数据实例化和加载新的对象。上调用新的类型的功能,以保持他们的数据。

Remoting Server uses the common data to instantiate and load the new objects. Invokes the functions on the new types to persist their data.

更多推荐

加载不同版本的同一总成

本文发布于:2023-11-06 22:47:42,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1564882.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:总成   加载   版本

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!