.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Post New Web Links

How to load a DLL Dynamically in c#

Posted By:      Posted Date: August 26, 2010    Points: 0   Category :SharePoint

I have one application, where based on some functionality i need to load and unload dll's. For Example, if the user wants to perform some normal arithmetic operations then the application has to load Arithmetic.dll. If the user try to perform some trigonometric calculations then we will load trigonometric.dll. And these dll's can be updated at any point time. My application is running as a background process.


My problem here is, I am able to load DLL's but i am unable to unload them while my application is running.

I have tried Assembly.Load . It's working fine.Even i am able to unload also.  But i an unable to use serialization functionality.

Then I have tried Assembly.LoadFile . Only Loading  of DLL and Serialization is working properly. But i ma unable to unload it.


Please anybody help me to fix this issue or please give me thoughts on it.


Thanks in advance.

View Complete Post

More Related Resource Links

Dynamically load user control without postback


Hi all,

I need urgent help. (c#coding)

In my base page, I have a dropdownlist control which loads different usercontrols on selectedindexchanged event.

While loading these usercontrols, my page postbacks all the page. I used updatepanel but again same problem.

Is there any way to load controls without postback? I Really need help as soon as possible.

Here is my code:

protected void Page_Init(object sender, EventArgs e)
        if (Session["control"] != null)
            string c = Session["control"].ToString();
            if (c == "1")
                iuc = (IlkogretimUC)LoadControl("~/Controls/Ilkogretim.ascx");
                dl.SelectedValue = Session["control"].ToString();
            else if (c == "2")
                luc = (LiseUC)LoadControl("~/Controls/LiseUC.ascx");
                dl.SelectedValue = Session["control"].ToString();
            else if (c == "3")
                youc = (YuksekokulUC)LoadControl("~/Controls/Yuksekokul.ascx");

Load dynamically assembly with dependencies

I'm trying to download .dll by having some url (http://somedomain.com/myassembly.dll) and load it into appdomain. Once I download this assembly I can't load it into appdomain, because it has some dependencies. Some of these dependencies I can found on my local machine (such as .NET libraries), but some of them I have to download and load into appdomain. So there are several questions: 1. How to determine list of dependencies without loading assembly into appdomain (and by having only byte[] as assembly) 2. How to determine which of these dependencies can be found locally Thanks, Paul.

Load the Excel File Dynamically?

Hi All, I want load the excel file in sqlserver destination. The excel file name is current date. How to load the excel file every day? Thanks CMK…

load TreeView data dynamically from differeny sources in WPF


This is regd treeview control in WPF.
My treeview should look like this

Here xxx and yyy(parent nodes) comes from XMl file and the 1,2,3(Child Nodes) comes from a different source and 9,8,7(Child Nodes) comes from other different source.
Here the problem is how to load treeview from different sources dynamically.
Can anyone guide me how to acheive it.

Tab Control - load user controls in tab dynamically when tab is selected


I have searched the forum and I cant seem to find the answer to my question, although I have tried some of the hints I have found with no luck....

Can someone show me a working sample (with source code) of a page with a TabContainer and several tabs, with each tab having a user control, but the controls are not added/initialized/shown until the appropriate tab is shown/clicked?

Something like this forum's "Write a New Post" page, where the tabs load after I click on them, and an animated picture displays to show that its loading.

The solution needs to add user controls to the page, not just html into a dynamic populate extender.

I have one user control per tab, and is linked (ala master-child relationship) to the page using a property. My user controls perform long-running web service queries, and I dont want to waste database/computing resources loading content into a tab that the user will never look at.   Right now, all tabs load their content when the page loads, even though the first tab is only shown.

As mentioned above, sample code for the page (.aspx and .cs) and the user control (.ascx and .cs) would really help.


How to index a page that uses jquery to dynamically load

I have an html page that dynamically loads content using jquery.  After the page initially renders, it takes 1-2 seconds for the data to be populated from the javascript.  As a result, the Sharepoint indexer is not able to "see" any of this dynamic content and it is not searchable.  Are there any workarounds for this? 

Enumerate all dll's and dynamically load them with REFLECTION


Hello guys,

Am trying out something new.


I want to

1. enumerate though the available dll files in a folder and using this code.

2. Dynamically load them with reflection


// GEt all the dll files


private const string dir =

Enumerate all dll's and dynamically load them with REFLECTION


Hello guys,

Am trying out something new.


I want to

1. enumerate though the available dll files in a folder and using this code.

2. Dynamically load them with reflection


// GEt all the dll files


private const string dir =

Dynamically Create Controls in ASP.NET by Using Visual C# .NET

This article demonstrates how to dynamically create a control for an .aspx page. The sample project does the following:
Creates two TextBox controls.
Verifies that the contents (TextBox.text) and the attributes of the TextBox are saved across posts to the server.
Illustrates handling events that are posted by a dynamically-created control

Dynamically Create Controls in ASP.NET with Visual Basic .NET

This step-by-step article describes how to dynamically create controls for an ASPX Web page.

The sample project does the following:
It creates two TextBox controls.
It verifies that the TextBox contents (TextBox.text) and attributes are saved across posts to the server.
It describes how events that are posted by a dynamically created control are handled.

Combine, minify and compress JavaScript files to load ASP.NET pages faster

Websites are getting more interactive these days and most of this interactivity comes from JavaScript. People are using different JavaScript libraries and frameworks to make their websites more interactive and user friendly.

DataTable - Load from IDataReader - CreateDataReader - ReadXml WriteXml - Free ADO.NET Tutorials

The DataTable in ADO.NET 2.0 has been seriously beefed up and I absolutely love it. Not everything we consume deals with multiple resultsets and requires the ever popular DataSet. With the cool new features in the ADO.NET 2.0 DataTable, we can get many of the cool features in the DataSet without all the extra baggage and memory footprint particular to multiple resultsets.

Load DataTable from IDataReader

ActiveSync 4.5 (Free Down Load) using in Windows Mobile Pocket Pc

Microsoft ActiveSync 4.5 is the latest sync software release for Windows Mobile-powered devices. ActiveSync provides a great synchronization experience with Windows®-powered PCs and Microsoft Outlook right out of the box.


* Faster file transfer speed and photo sync via Outlook are only available for Windows Mobile 5.0 powered devices.
* Remote PC Sync (via WiFi or LAN) has been removed due to Enterprise customer feedback around security issues.
* Customers using Microsoft Exchange 2003 Service Pack 2 with devices running the Messaging and Security Feature Pack for Windows Mobile 5.0 will benefit from the following feature enhancements included in ActiveSync 4.5: Direct Push Technology, local device wipe, and certificate powered authentication to Microsoft Exchange.
* Microsoft® Outlook® 2000 is not supported by ActiveSync 4.5. It is highly recommended that users upgrade to Microsoft® Outlook® 2003 messaging and collaboration client.
* Conversion of database files for use on a mobile device is not supported by ActiveSync 4.5. On previous versions, this feature was limited to devices running Windows Mobile software for Pocket PC 2003 and earlier.
* Conversion of font files for use on a mobile device is not supported by ActiveSync 4.5. On previous versions, this feature was limited to devices running Windows Mobile software for Pocket P

dynamically adding sql server columns based on number of files in fileuploader


I want to create a new table to sql database at runtime.  The column names would be "Name", "Date", "Event".  I would also like to have one more column name "Image" but the problem is that since the amount of images will vary, I want the application to count the amount of files in the Multiple fileuploader and then add a image column to the table for the respected amount of files. 

For example if i am uploading 3 files in the multiple fileuploader, the names should be "Name", "Date", "Event", "Image1", "image2", Image3"

I also would like that table name to be name dynamically from the textbox Name when the user enters the information.


I have the following code to make a new table, but I dont know how to name the fields at runtime like previously asked please help!!!


Dim objConn As New SqlConnection("Server=<servername>;uid=<userid>;pwd=<password>;database=master")


ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend