C# - Reuse Loaded Assemblies In Web-Based Plugin Architecture. Maximize Performance

Aug 6, 2010

Edit: I would like to keep the infrastructure as is, so while the framework ideas are appreciated, please keep your suggestions centered on the context I have provided.

Background

I'm building a web-based application that dynamically loads plugins. Each plugin comes with a manifest file that contains its dll location, namespace, and type.

Right now I'm using System.Reflection.Assembly.LoadFile to load up the dlls based off the locations provided in the manifest files. Then I load the types and so on.

As an Aside:
I may wind up changing to System.Reflection.Assembly.LoadFrom since I'll eventually be loading files from outside the bin directory. But if their is a better way (Assembly.Load or something), feel free to add that in as well

Problem

The problem is that Multiple plugins can potentially run off the same dll. So I wind up executing System.Reflection.Assembly.LoadFile("Identical.dll") multiple times.

I have the idea to check if my assembly has already been loaded by iterating through AppDomain.CurrentDomain.GetAssemblies(), but I don't know if that will help with performance (or if it will work period, I haven't tried it).

Also, I can't keep a list of loaded assemblies due to the project's design constraints (though you may argue that it's a poor design: I can't change it, even if I wanted to OR agreed with you... so please don't press the issue.

Ultimately my goals are:

Don't ever re-load the same assembly twice. Performance is key.

View 3 Replies


Similar Messages:

Web Application Architecture Performance In Single And Many Assemblies One For Each Tier

Aug 2, 2010

I'm building a new n-tier web application and I would like to know the performance differences between developing my tiers in one single assembly (each tier with its own namespace) or into different assemblies, one for each tier.

View 1 Replies

Web Forms :: Performance - Page Is Being Loaded For The First Time Vs SubSequent Request?

Sep 17, 2010

I have some serious performance Issues with Windows controls loading first time on IE Browser then subsequent request's. When ever i open Browser first time , mywebsite takes 7 seconds to load, but on subsequent request without closing browser it loads with-in 2 seconds.I Knew IIS on first time it re-compiles the process and for subsequent request's it wont perform and it cahches .I'm looking for better options to improve performance, when ever first time reqest's comes to web server.

On IIS 7 Server,I was using both Dynamic and Static compression enabled.Also,On application pool ,I set "ShutDown Time(Limit)" and "Startup Time(Limit") to 90 (seconds).Here is web.config i disable below to improve performance issues.

<trace enabled="false" pageOutput="false" />
<compilation debug="false"/>

Here is the Server Configuration

Windows 2008 Server
IIS 7 64 bit
Upto Date patches.
.Net Framework 2.0,3.0,3.5

Need inputs to improve performance when user call website for first time.

View 2 Replies

.NET Plugin Architecture Without Using Reflection Or Static Constructors?

Nov 11, 2010

I have an ASP.NET HttpModule that is distributed as a DLL. I badly need a plugin architecture so I can isolate some heavyweight, rarely used features into external .dlls, and speed up/slim up the core functionality.I've experimented with (1) reflection and (2) static constructors.It seems GoDaddy and a few other web hosts prohibit use of Reflection, making #1 useless..NET 4.0 now calls static constructors lazily, eliminating #2.

How can I have a generic plugin registration system that doesn't require C# or VB code to register the plugins? Even a web.config plugin registration list would be fine, but I don't know how to do that without using reflection.

Update: I need this to work in .NET 2.0 as well as higher versions

View 1 Replies

C# - Late Binding In Child AppDomain - Develop A Plugin Architecture

Oct 1, 2010

I am trying to develop a plugin architecture in .Net. The application will be a .Net application. There will be directories which holds the plug-ins. Each directory will represent a plugin. Each plugin directory will also contain all the dependency dlls as well. The plugins need to be stored in separate AppDomain as the plugins may use the same assemblies, but different versions. As it iterates through the foreach loop in Init(), I get a System.IO.FileNotFoundException : Could not load file or assembly '[Assembly Name], Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.in _apDomain.Load() for assemblies that are not in the main project.

readonly private AppDomain _appDomain;
internal ItemModuleAppDomain()
{
AppDomainSetup info = AppDomain.CurrentDomain.SetupInformation;
_appDomain = AppDomain.CreateDomain("ChildDomain");
}
public void Init(string dllDir)
{
string[] dlls = Directory.GetFiles(dllDir, "*.dll", SearchOption.TopDirectoryOnly);
foreach(string dll in dlls)
{
_appDomain.Load(AssemblyName.GetAssemblyName(dll));
}

View 1 Replies

Architecture :: Performance Between 3 Or 2 Layer With Linq

Mar 13, 2011

i build online course selection for a university now i want to make it layering and i dont know to make it 2 layer or 3 layer i mean mix business layer and database layer because i use linq so it is not require to check request data that in sql from client in business layer because linq check it autimatically to preent injection and etc.is it right?can i put my class and DB class in same place or layer?if i make it 2 layer the performance becom better?

View 5 Replies

Architecture :: Performance Difference Extracting And Copying In Website With C#?

Dec 11, 2010

I have almost 100 website that will update in a condition, I have a winzip archive that contains the files that replaces those websites. I want to know that

I can extract that files in a folder and then copy them to all 100 websites folders

I can extract the archive directly to 100 websites folders

which one is better in performance and less prone to errors

View 1 Replies

Architecture :: Object Instances In High Performance Web Applications

Sep 21, 2010

Imagine I have a class MyTestClass. And I need an instance of this Type throughout my whole web application.Now there are several possibilities to accomplish this.1. Make MyTestClass static, make it contain static methods only
Probably the most performant solution. I'm not feeling lucky about using static fields though. Thread safety? What if my static class contained a static System.Collections.Queue?

View 8 Replies

Architecture :: How To Process Data After Page Is Completely Loaded For The User

Aug 23, 2010

I have some logging that has to be done, which are some database update or inserts.

However this logging is of no importance to the user, so I only want to process the data/logs after the page is completed for the user.

As of now, if I process the data while the page is loading, I go from 1.4 to 2.0 speed (server side time processing of code), which is quite a bit comparing it is of no use to the user.

So I want this code only executed after that the page is complete.

I've been checking out Ajax, async pages etc, but the problem is it still gets executed before the page is rendered to the client, which means the client will have to wait longer then it is not being processed.

I've been checking out Threadpool.queueBackgroundWorker, however if I get it correct, this will still be executed before the page is shown to the user, as it has to complete before the prerender.

Then I thought about creating a new thread, and do the processing there, which would not have my page waiting to complete the data/logging.

However when I have 100 or 200 users loading pages at the same time, then that would mean I would be creating 200 threads on those loads, which I doubt will be good for performance. So if I want to solve this, I would have to create my own threadpool and only assign for example a max of 40 threads to it which can process the data.

All I want to get done, are some update/inserts into database after the page is rendered and shown to the user. I don't want the logging to slow down the pageload for the users obviously. I want that logging or no logging makes no difference to the pageloadtime for the user at all.

View 5 Replies

Architecture :: Read And Analyze A Very Large Log File With High Efficiency And Performance?

Sep 13, 2010

It is a very large .txt file (more than 3M), and produced everyday, the content is user's system log like below:

2007-11-01 18:20:42,983 [4520] INFO GetXXX() SERVICE START
2007-11-01 18:21:42,983 [4520] WARING USER ACCESS DENIED
2007-11-01 18:22:42,983 [4520] ERROR INPUT PARAMETER IS NULL CAN NOT CONVERT TO INT32
2007-11-01 18:23:59,968 [4520] INFO USER LOGOUT

View 14 Replies

Architecture :: Services Based Architecture

Aug 19, 2010

was giving a though on using ajax enabled wcf services as part of architecturegenerally wht im usingis UI-> BL-> data accessis it suggestable to use wcf services layer insteadof BLnd hv UI-> services-> data accessrelated to asp.netwould like to no pro's and con's of doing this thing.

View 2 Replies

Configuration :: What Is The Diff Between Link To Assemblies In Project File And Assemblies In Web.config File

Apr 30, 2010

when I reference a assembly. It's reference gets added to the project file in my case ( ABC.csproj)

Also when I take a look at the web.config file there is a section called <assemblies>. And lot of assemblies are added there.

What is the difference between link to the assemblies in the Project file and the assemblies in the web.config file?

View 1 Replies

Architecture :: Going To Develop A Web Based Application With C#?

May 30, 2010

i am going to develop a web based application with c# but i am very upset that how to design a good pattern how to code to let the program more efficient.

View 3 Replies

Architecture :: Framework For A ERP Web Based Application

Mar 31, 2010

I am designing frameWork for an ERP application ijust have some quries regarding it

Some standards have to be set for this project ,need some help for it.

1)folder structure of the project for frame work 4.0

2)Layering should be done like(3 tier,n tier) if i want to Go for more than 3 layers what could be the other layers except BAL,DAL,Presentation.

3)should all the images be called from css,or some images can be called from the page it self.

4)what benchmarks should be set while writing Stored procs,to make uniformity and increase performance.

5)what securtiy messaures should be taken so that application remains free for intruders.

View 3 Replies

Architecture :: What Is Component Based Development In Dotnet

Feb 19, 2010

1. Can you explain me what is component based development ? What I am already doing is using layers (user interface, custom types, data access layer and busines logic layer). For example for filling a drop down list with countries what I do is getting data from DAL using custom types in my BLL and BLL return a list of countries to user interface. Now in my opinion it is a plug-able component that I can use anywhere. Should it be called a component ?

2. What is a component a method ? or class or a assambly ?

3. Can components be like that (methods and assemblies) or they are services to embed ?

4. Actually I never have used services, if component can be in both ways (services & classes and assemblies) than what approach is better, should component be made in form of assemblies or services ?

5. Without being so technical any general rules on making re-usable components ?

View 2 Replies

Architecture :: Opinions Based On Design Guidelines?

Feb 17, 2010

i just want to make sure that i am folling the correct pattern and following the right practice and i have read the book (Wrox.Professional.Enterprise.dot.NET) and based on that book here is what i come-up with my design.

my solution consists of:

Model,
Repository,
Service,
Test,
UI

[Code]....

View 17 Replies

Architecture :: Accessing Different Database Based On The Username

Dec 1, 2010

I am working on a website where when the user logs in, I select their database based on their username. Currently I have a list of all databases in the web.config and I select the Database ID from the username and then read the database string from web.config. What is the most optimal way to implement this scenario?

currently I:

- store the Database ID in the session object

- the Session object expires after like 5 minutes so i have to read the Database ID from the online database based on the username and regenerate the Session["DatabaseID"] again.

- there are some security issues with the Session ID, so I started clearing the Session in !(Page.IsPostBack) and I generate the Database string again.

Where shall I store the DatabaseID and the database connection string so I can easily reuse it once the user has logged in?

View 8 Replies

Architecture :: Create REST Based Web Service Using Asmx?

Apr 12, 2010

Is it possible to create REST based web service using asmx?

View 1 Replies

Architecture :: Showing Mathematical Formula Based Charts To End User?

Jun 3, 2010

We have one new project to implement. Let me explain briefly about this project. This project is related showing chart to end user on the basis of different mathematical calculated formulas.

End user has authority to change these formulas on the fly and on the basis of that changed formula we need to show the chart. So this is all central idea about the project. These charts which I mentioned above are very complicated and user friendly

So can any buddy tell me which is best suitable architecture for this and how can fit her to my scenario .I knows, three tier architecture and some other are there but I want know which is the best architectures that developed above idea in right way

View 3 Replies

Architecture :: Implement Field Level Security Based On The Roles

Jul 22, 2010

I need to implement field level security based on the roles. I have a page Employee.aspx . In that i have ten controls. If i am enter as admin role i need to show all the controls. If i am enter as user have to show only five controls. How to design the appplication for control level security?

View 5 Replies

Web Forms :: Create A Simple Class Based One Tier Architecture

Mar 20, 2014

I am beginner in asp.net / vb.net and I developed a web application for inventory management. here I have my insertion procedure that I entered in my code behind all the different page of my application. My problem is the following:

* I would like to put my procedure in a class that I will call on my different page * how to create this class * how to call this class on my pages

here is my procedure:

Private Sub reqinsertion (ByVal sreq As String)
         Dim con As New System.Data.Odbc.OdbcConnection ("Dsn = dshealthboard")
         Sun ocommand As System.Data.Odbc.OdbcCommand
         con.Open ()
         ocommand = New System.Data.Odbc.OdbcCommand (sreq, con)
         ocommand.ExecuteNonQuery ()
         con.Close ()
     End Sub

View 1 Replies

Web Forms :: How To Maximize A Table

Jun 23, 2010

I am trying to create a Master Page using a table that has 3 columns and 3 rows. It seems to work accept to see the entire page I have to scroll the page. My question is how can I maximize the table to fit in the web form.

View 4 Replies

Configuration :: .Net Website Performance Of 2 Sites - Rectify The DB Performance While Insertion?

Sep 20, 2010

I have developed a website in asp.net framework 2 . This website is being hosted in two different servers without any change in code. My issue is about the performance of these 2 sites. One website is taking much time for inserting datas to the DB (SQL server 2005). 2 websites are having different DB server.

I think the issue is for the DB server. How can we rectify the DB performance while insertion and Is there any other cause for this permance issue?

View 1 Replies

Web Forms :: Minimize And Maximize The Browser?

Mar 9, 2011

I am open up the <div id="movMe"> with the ImageButton lnkBtnColHelp and animationextender. The <div> is not visible when I have pressed the button. But if I minimize and maximize the explorerwindow the <div> becomes visible, I do nothing more than that. So it is there but cant be seen.

What does this depend on? I dont know if I need to focus the <div> in somehow. I tried to put a function
moveMe_Clicked() but that did not help. [Code]....

View 1 Replies

DataSource Controls :: LINQ Performance Application Performance Is Not Up To Par?

Apr 29, 2010

I am not sure if this is the right forum. I can not find a forum for LINQ.

I am working on an application using LINQ. Application performance is not up to par and my tests show that it is LINQ queries that are slow. I was wondering if anybody can recommend where I can find an article about optimizing LINQ performance maybe by compilation or other methods.

View 1 Replies







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