English 中文(简体)
Is System.AddIn mostly about making it easier to use Remoting or does it make it harder to do so?
原标题:

It takes at least 7 assemblies and restricting my AddIn s data model to data types that remoting can deal with before the appdomain isolation features begin to work. It is so complex! The System.AddIn teams blog implies to me they were trying to re-create a mental model of COM, a model I never understood very well in the first place and am not sold on the benefits. (If COM is so good why s it dead?-rhetorical question.) If I don t need to mirror or interop with legacy COM (like VSTO does using System.AddIn), is it possible to just create some classes that load load in a new AppDomain?

I can write the discovery code my self, I ve done it before and a naive implementation is pretty fast because I m not like iterating over the assemblies in the GAC!

So my specific question is, can I get the AppDomain isolation that AddIns provide with a few code Remoting snippets, and what would those be?

最佳回答

I m not entirely sure that that any answer to your question meets the terms of the site - there is no solution.

Yes, remoting is easier as it is done for you. However, it is highly controlled and as you identified, requires a little work to plumb it all together. The cache file spewed out by the discovery process is hardly welcome either.

System.AddIn excels at isolation, which is actually a bit of an arse to put together from scratch in a robust, flexible way. It supports cross process hosting and fairly simple passage of user WPF elements from one domain to another.

One thing to remember however is that MAF s target audience is not those who are trying to connect two applications together. It is targeting developers wanting pluggable yet secure systems (cross process hosting protects the root application from unhandled exceptions, appdomains allow for executing potentially foreign code with defined security). From most communication, direct yourself straight towards System.Runtime.Remoting or WCF.

If you want to continue with System.AddIn, consider the pipeline builder plugin for visual studio!

In conclusion - you can get System.AddIn isolation using Remoting but to get a decent system you will require more than a few snippets. I am trying to replicate it myself and am tripping up all over remote interface component - something System.AddIn does without a hitch.

问题回答

After messing around with System.Add for quite a while, I m convinced that it was added as a one-off special purpose solution for Microsoft use. I m surprised it got elevated to a core part of the .NET framework. It doesn t seem to have the refinement and polish needed for a general .NET framework component.

I d like to find an alternative way to create .NET managed add-ins that doesn t require so much effort.





相关问题
Remotely pass messages to c# console app

I need to be able to send a string message and receive a string response from a console app running within our organization. I want to pass simple strings back and forth from a remote IP address. What ...

AS3: What s newer/better than AMFPHP

I m aware that AMFPHP has long been used to connect php with flex. I remember I read somewhere that there s something better now, but I didn t take a note of it, and of course now I forgot. Does ...

Deserialize AmfPhp messages

Is it possible to deserialize the AmfPhp messages while remoting? They are in binary, and assuming that amfphp understands what they are I should be able to decode what it s. How to ? is this ...

executing context for a Windows Service

I have written a windows service in C# that essentially listens for commands on a specific port and in most cases will create a new Process class and shell execute said task. I primarily want to use ...

热门标签