[英]C# MAF Activate AddIn without locking dll
Using System.AddIn, is there a way to load and activate an AddIn without locking the .dll file? 使用System.AddIn,有没有一种方法可以在不锁定.dll文件的情况下加载和激活AddIn? I want to delete or override the file to load a new version of my AddIn.
我想删除或覆盖文件以加载我的AddIn的新版本。
The only way to unlock the file at this moment is shutting down the AddIn. 此时解锁文件的唯一方法是关闭AddIn。 But I need to keep it always alive for incoming calls (Async-service, yes, a nightmare).
但是我需要让它始终保持来电状态(异步服务,是的,噩梦)。
Or maybe there's another way to update AddIns at runtime, and I'm not doing it right. 也许还有另一种在运行时更新AddIns的方法,但我做的不正确。 I'd like to know wich can be the correct way to do this.
我想知道wich是执行此操作的正确方法。 Thanks!
谢谢!
What about the ShadowCopy functionality of the System.AppDomain class? System.AppDomain类的ShadowCopy功能如何?
I haven't given it a try yet, but you could try the following: 我还没有尝试过,但是您可以尝试以下方法:
You can find more info on shadow copying here . 您可以在此处找到有关卷影复制的更多信息。 Also read this thread at System.AddIn Tools and Samples page at CodePlex.
也可以在CodePlex的System.AddIn工具和示例页面上阅读此线程。
Once you load the new version, how would you expect handover to work? 加载新版本后,您如何期望切换工作?
Sounds like you need two add-ins: one (that you never change) to just receive and buffer incoming calls, and another (that you do change) to do the work of processing those calls. 听起来您需要两个外接程序:一个(您从未更改)仅接收和缓冲传入的呼叫,另一个(您确实更改)来处理这些呼叫。 Then you can shut down and upgrade the processing add-in.
然后,您可以关闭并升级处理加载项。 The message-receiving add-in meanwhile can buffer the async calls until the new version of the processing add-in is up and running.
同时,接收消息的加载项可以缓冲异步调用,直到新版本的处理加载项启动并运行为止。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.