Stable Plugins Architecture Using An Appdomain Per Plugin?

Jun 22, 2010

how to create a stable plugin architecture. Stable because I plan on opening up plugin creation to the public but I dont want a sloppy coded plugin to take down my whole application.

So I thought of using an AppDomain per plugin and I did a little seaching. But it seems that even using a temp AppDomain to load plugins and then unloading it once all assemblies have been inspected raises complexity allot and I was planing on using an AppDomain per plugin.

I feel the gained stability (if there is any at all) may be raising the complexity so much the app will never be done..

Is there another way to both create a stable application and at the same time making it extensible?

I cases where the host calls a defined function via say IPluginInterface I guess I can pack a whole lot of try catch blocks around that call but what if a plugin insisted of a timed routine that would run continously without being invoked from the host other that a starting call to StartPluginService or something like that?

If I include a plugin like that in the default AppDomain and it blows up I sure will blow my own foot off right?

View 3 Replies


ADVERTISEMENT

Create A Plugin System Where Plugins Can Be Dynamically Loaded?

Dec 21, 2008

I am trying to create a plugin system where plugins can be dynamicly loaded (we don't know how many there are, what their classes are called, ...)This is sample code for a plugin:

Code:
Public Interface IPlugin
Sub bla()
Function bla3() As String
End Interface

[code]....

This code SHOULD msgbox("yay") when it finds a type that implements my IPlugin interface. Yet it never finds one. I can't find what I did wrong. It gets to the debug.print("2"), but never gets past the "If GetType(IPlugin).IsAssignableFrom(t) Then".

View 4 Replies

A Plugin Architecture In .net And Handling Events

Nov 5, 2009

I need to write an app that that will iterate over our database, and perform various anaylsis on each record. In order to do this (partially for the learning exercise in creating plugin support) I want to use a Plugin model.

Currently, I have a simple Interface in my main app, which plugins can Implement. My app then loads all DLL's in a folder looking for ones implementing the Interface.

As you can see in the pseudo-code below, I have to keep performing a loop through all loaded plugins calling the process methods.

Sub ProcessData()
For Each Record In MyDataSet
For Each Plugin In MyPluginCollection

[Code].....

View 3 Replies

VS 2010 : Creating New AppDomain To Load/unload Plugin Dll's?

Dec 29, 2011

I'm in the process of trying to create a new appdomain to load plugin dll's, then unload the new appdomain so I can update the plugin dll's without having to exit the main application. There are many, many examples out there and it looks like it should be fairly straightforward, however I'm having a problem where the main application is loading the plugin dll's along with the new appdomain. Of course this is a problem because I cannot overwrite the plugin dll's if they live in the main appdomain. Based on the examples I've seen the code below should only load the plugin dll into the new appdomain, however for some reason it also loads into the main appdomain.

Dim oDomain As AppDomain = Nothing
Dim oSetup As New System.AppDomainSetup()
With oSetup

[code]....

The IDPAPlugin interface is in a seperate project that both the plugin dll and the main application reference.

View 2 Replies

.net - Plugin Architecture - Make An MDI Parent Form Aware Of Children In DLLs

Jan 25, 2010

I'm experimenting with a plugin architecture for my company's internal business system. I have managed to read all .DLLs in a Plugin folder which implement a specific interface. What I am trying to figure out is the best method of communication between the "host" MDI parent application and forms that will be in the .DLLs which I intend to make MDI children.

Currently, I am returning just ToolStripMenuItem objects from the .DLLs to add to the MDI Parent. I've also tested that events wired in the .DLLs to the ToolStripMenuItems do propagate to the code in the .DLLs. I've also managed to return a Form object via the interface and open that form, as the Plugin folder is being "scanned".

However, I am not clear how I would make these forms MDI children. Also, any other forms living in the .DLLs will also have to be MDI children. I created a VS 2008 Addin project just to see what's going on, and it seems that the Addin accepts an Application object on which it adds to the ToolStripMenuItems and does other operations. The code to build the menu inside the .DLL. This is opposite of what I have done so far, where the MDI requests a ToolStripMenuItem from each .DLL and adds the returned object to its own menu.

Would designing my plugin architecture to accept an application object in the same manner the only way I could get forms to open as an MDI child? Am I asking for other, currently unknown to me, headaches by NOT passing in the application object to the .DLL?

View 1 Replies

How To Stable Sort Using A Key

Nov 23, 2008

I was wondering if anybody knew how to stable sort an array in VB.NET using a key.Basically, I am reading 2 CSV files and populating 2 arrays in parallel. The first array (asLines) holds the entire lines read from both files, and the second array (aiTrans) holds only the transaction #'s from those lines (the 2nd field of the line).What I want to then do, is stable sort asLines using aiTrans as the key.url...How can I sort asLines using aiTrans as the key and keep the order?

View 4 Replies

C# - OrderBy And OrderByDescending Are Stable?

Jul 30, 2009

I am currently reading Pro LINQ c# 2008, and in page 87 the guy says OrderBy and OrderByDescending are stable. But he says exactly the opposite in page 96. It looks to me as he is referring to exactly the same functions, so I don't get it. Are they stable or not?

View 2 Replies

C# - Access To Standalone App With More Stable Database?

Jan 4, 2010

Does anyone have experience of rapidly translating an access application into a standalone windows application? My current thoughts are to create an SQL database and a gui in c# and vb, or adobe flex 3.As with acces, the GUI would mainly comprise of controls such as radio buttons, combo box (populated from a table), check boxes, text boxes, text areas and data grids. It will also need the ability to create reports as access does.

View 2 Replies

Make Connection String As Stable(unchanged For All Environment)?

Jun 6, 2011

i am using MS ACCESS DATABASE for data processing in vb.net, so i need to change the "connection string" while re-compile in another machines ,so i want to make connection string as stable(unchanged for all environment)

View 3 Replies

.net - Createinstance() - Put Together A Plugins System With .NET

Apr 12, 2009

I'm trying to put together a plugins system with .NET, and I'm not sure if I'm doing it correctly. The basis of the system is that a specific directory ({apppath}/Plugins/) will have a bunch of precompiled DLLs, and I want to look through each one with reflection, and for every class available, if it inherits a specific base class (this is defined in yet another DLL, but I'll go into that later), then create an instance of it and call a specific function in said instance.

Public Sub ScanPluginsInDirectory(ByVal Directory As String)

Dim Plugins As New IO.DirectoryInfo(Directory)
Dim Files As IO.FileInfo() = Plugins.GetFiles("*.dll")

[CODE]................

The specific problem I have is, I'm not sure this is the right way to do this. Would the method I'm trying to do work, if it can be assumed that A.Plugin() actually exists and any structures and classes referenced here are bug-free?

View 2 Replies

Make Plugins For The Program?

May 20, 2011

expand my program by allowing people to make plugins for the program. I thought of a way to do this: They can make a form/plugin on a form in VB then they can save it and upload the Form1.VB file and when you put that in a folder made by my program in "My Documents" my program will run that form like its, its own.

View 3 Replies

Plugins And Extensions For A Vb Application?

Mar 9, 2010

Firstly, I understand that this might sound more or less abstract, but this is because I have no previous experience in such applications. I completed an application using Visual Basic and is running and tested. What I want to do is
to make this application expendable i.e I could write other pieces of code and I would just plug it in to the application "somehow" and it would be added as a functionality.

View 1 Replies

Eclipse IDE, C# And Plugins That Supports .Net Framework4.0?

Sep 4, 2011

I want to use C# and VB.Net in Eclipse 3.7 Indigo.VB.netI could not find the plugin about VB.net in Eclipse.So I want to know is there a plugin for Eclipse that allows you to write C# or VB.net code using the .Net Framework 4.0 or 3.5?

View 1 Replies

Editing Settings For Individual Plugins?

Jun 6, 2012

I have a vb.net project that loads "plugin" dlls at runtime to crunch some data in slightly different ways and return the results. To do that, all the plugins implement the same interface, so the GUI couldn't care less how the plugin arrives at its final dataset, just so long as all the plugins deliver it back to the GUI in the same way.

I'd like to set up per-plugin options in addition to the main program options. I have an options form that accepts an object of type System.Configuration.ApplicationSettingsBase and displays the contents in a PropertyGrid control, so it'll show any My.Settings object the same way. Question is, how do I pull the My.Settings object out from a plugin that's loaded at run-time?

View 1 Replies

Can't Make A Seekbar Control Using A Windowmediaplayer And Vlc Plugins?

Oct 10, 2011

I cant make a seekbar control using a windowmediaplayer and vlc plugins

View 1 Replies

Development Techniques - Make A Program That Can Be Used With Plugins?

Aug 19, 2010

While I've mainly been developing small applications for personal use, I stumbled upon making a touchscreen application for a close friend. While he is not very good at programming, he is pretty well at drawing/etc... So, I thought about expanding my horizons some.I already have code that loads images from a folder, and made that folder changeable via the program, so in effect, probably a horribly coded way of skinning some parts of the program (the buttons). But then I though about it some more and really wanted to learn a better way to make my programs 'expandable'.I have begun searching about how to make a program that can be used with plugins, how to make plugins, and so on... I am researching about dynamically changing controls and other things, so that when resolutions change, I don't have to code each individual buttons new size/location, and, most importantly, a way to implement patching/app upgrades...

View 2 Replies

Plugins - Org Chart Control/Plug-In For WPF Multitouch Application?

Nov 5, 2010

I have been working on a UI app (written in VB.NET and using WPF) which creates charts using the Microsoft Chart Control for Windows Forms. The application retrieves data periodically from a remote database, parses and formats the data to create series, and then creates a chart based off the series which is then hosted in a WindowsFormsHost control. So far this process has been working well.

View 1 Replies

Find AppDomain By Name?

May 11, 2011

have created a new AppDomain with a unique name. But i do not want to store that name during the whole application runtime.So i ask you guys if it is possible to get that created AppDomain by name back.

Sub Main()
AppDomain.CreateDomain("TestDomain")
End Sub

so How do i get the AppDomain with the name "TestDomain" back so i can unload it later without storing that AppDomain globally?

View 9 Replies

What Is AppDomain.CreateDomain

Jan 19, 2010

What is AppDomain.CreateDomain

View 2 Replies

.Net, AppDomain Unload Via An Interface?

Dec 2, 2010

I have an ApDomain that is running a Main Routine, for example:

Public Sub Main() Implements Interfaces.IScript.Main

For a as Integer=1 to 99999

[Code]...

View 3 Replies

Difference Between An AppDomain And A Process?

Apr 28, 2009

Can you have more than one AppDomain in a process Or more than one process in a AppDomain? What about threads? I was always told there were many threads in one process and one processor has many processes. How does App Domains fit into this picture?To me, it seems like its the same concept with a different name??

View 1 Replies

Load DLL In Separate AppDomain?

Jun 16, 2007

the forum,this is my first message, and I hope that my English is understandable (I'm Italian)....I've developed a WIndows Service using VB.net 2.0; this service executes a routine every 4 hours... I would like load a dll (without entry point) at run time and when the operation is terminated, I would like unload that. I think that I've to create a new AppDomain and to load my DLL into this, but I don't know the good way to do it.

View 9 Replies

Add Custom Plugins For The App For Additional Features, Without People Having To Download A Whole New Update Each Time?

Nov 28, 2009

I am trying to figure out an easy way to add custom plugins for the app for additional features, without people having to download a whole new update each time.i guess the way i'd want it to work is,the program will auto detect the plugin file. Then, add's a specific value to either a button array, or add's a picture, etc.Once that button is clicked, it will open a new form designed the way i want it. from within the plugin itself.So its a module.What would be the easiest way to do this?

View 2 Replies

.net - AppDomain Only Partially Respecting InitializeLifetimeService (if At All)?

Feb 23, 2012

First, I changed my ILS function to be simply: Public Overrides Function InitializeLifetimeService() As Object Return Nothing End Function

Then I included this in my Program as well as A. As Timiz0r pointed out, Form inherits MarshalByRefObject, so I didn't have to include a Inherits statement on my main class (which already inherited Form). This was the big thing, because I didn't include it originally. Next, I changed my AppDomain setup to be:

Dim _ADomain As AppDomain = AppDomain.CreateDomain(Name)
Dim item As New A
item = CType(_ADomain.CreateInstanceAndUnwrap(GetType(A).Assembly.FullName, GetType(A).FullName), A)

With these changes I can now use separate instances of the DLL COM object as desired.

Original Question I am writing an application that creates a list of objects, each referring to a DLL, and each object placed in its own AppDomain to keep the instances of the DLL from interfering with each other. Taken another way:Program maintains a List(Of A)A is created as an instance of AppDomain using CreateInstanceAndUnwrap Each A refers to mirror.dll, which is including in the application's references

[Code]...

View 1 Replies

AppDomain Instance Creation Error

Aug 16, 2010

I keep getting a "System.Runtime.Serialization.SerializationException" in my application while loading a not-defined assembly (AKA: Plug-in loading.)Even if I turn Serialization on for that plug-in, then it will fail once again. I've been looking around and couldn't find a good tutorial about it..

So all together: How to load an assembly using AppDomain?

View 10 Replies

AppDomain, WebBrowser Memory Leak?

Apr 23, 2011

I have done a lot of research on the memory leaks present in the WebBrowser control, and the following thread (http:url]...) told me that the only real way to reclaim the memory eaten up by WebBrowser is to load the control in a separate appdomain.I went ahead and did this, but when I unload the AppDomain that the WebbBrowser is created in (using AppDomain.Unload()), the memory is still not freed. I am looking at the Private Bytes of the process in Task Manager (which is accurate and what I'm interested in) to confirm this. The memory usage stays at 50MB+ instead of its default 5MB.Here is my code:

Form1.vb
Imports System.Reflection
Public Class Form1
Private ad_WBInst As AppDomain[code].....

View 6 Replies

AppDomain.Unload Does Not Free Up The Used Memory

Oct 23, 2011

I'm kinda new here, and I didn't know what forum to put this in, so I just put it here. I wanted to load an assembly to an Application Domain, use it, then unload it when I'm done with it. The assembly uses too much memory. The problem is: After I unloaded the assembly, the memory used is not getting freed. I was watching the performance all the time. The available memory increases only after I close the whole application. And that assembly is the only thing that uses a lot of memory in my application. Here's the code I used to load and unload the assembly: How can I free up the memory without closing my application. The memory was suppose to get freed up by simply unloading the assembly that uses it much.

View 2 Replies

Cross-AppDomain Singleton With Remoting ?

Mar 8, 2011

I have an Addin for MS Excel which needs a singleton to share data amongst modules.Depending on the version of Excel (2003, 2007, 2010), and how Excel was started, it calls my addin from different, unpredictable AppDomains, which prevents the classic singleton approach.Creating a custom AppDomainManager won't work because Excel has already created the AppDomains before the addin is called.

Linking to mscoree to enumerate domains breaks the addin registration process (and I really don't want that anyway); there doesn't seem to be any other way of enumerating, so that isn't an option either.The only solution that I've found is to use remoting. Here's my test rig:

Imports System.Runtime.Remoting
Imports System.Runtime.Remoting.Channels
' Remeber to add reference to System.Runtime.Remoting DLL[code].....

Once everything is running, access to the singleton takes ~100µS, which is perfect. I can live with the ~400mS the first time each AppDomain is initialised. The problem is at startup, where the remoting invocation takes ~2.5 seconds.

View 1 Replies

Get The Information Of All The Appdomain Created In Given Process?

Sep 26, 2010

I need to get the information of all the appdomain created in given process?

View 4 Replies

Appdomain.unhandled Exception Event Is Not Always Executed

Jan 5, 2011

I have a service application that randomly stops without any errors in my log or in the event application log. I believe that there could be an unhandled exception somewhere in the code so I set up the AppDomain.Unhandled event to catch any exceptions. While trying to induce unhandled exceptions I have found that this event is not always fired. I added the following code to my service's Shared Sub Main method (but I orginally had it in the OnStart method and was seeing mostly the same thing)

Dim currentDomain as AppDomain = AppDomain.CurrentDomain
Add Handler currentDomain.UnhandledException, Address of MyHandler

View 7 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved