How to Bin Deploy ASP.NET Assemblies on Shared Servers

On ASP.NET platform it is quite common to use 3rd party assemblies like MVC, MS chart controls to add features accessible from your code which are not present in the .NET framework by default.

In your development machine, you do this by installing the required assembly server-wide. Assemblies get installed in Global Assembly Cache (GAC) and all you need to do is to reference that in web.config file.

However, it may not be possible to install all these 3rd party assemblies in a shared server as different users might be using different versions of the same assembly.

Here comes the power of .NET framework which allows the assemblies to be deployed “locally”. The .NET framework first checks the bin folder for any assemblies before it checks the GAC. Deploying the assemblies involves the steps mentioned below:

1. Obtain the assemblies

If you have installed the assemblies in your development machine, you will find it there. Or, you can download it from the respective vendor’s site, say assume it is a MS chart control or new version of URL rewrite module, download the source and binaries, extract it to your development machine and locate the .dll file(s)

2. Upload the assembly

Create a bin folder outside of your application folder (if you are deploying your application to the root of the site, create a bin folder outside wwwroot folder) and upload the dll you extracted in #1.

3. Load the assembly in your application

This is the most important part and I would recommend having a .NET developer configure this as some assemblies require different definitions in the web.config file. A sample one looks like the one mentioned below:

<configuration>

<configSections>
<section name=”MODULE”
type=”MODULE_TYPE, DLL_NAME” />
</configSections>

<system.web>
<httpModules>
<add name=”MODULE” type=”MODULE_TYPE, DLL_NAME” />
</httpModules>
</system.web>

<system.webServer>
<modules runAllManagedModulesForAllRequests=”true”>
<add name=”MODULE” type=”MODULE_TYPE” />
</modules>
<validation validateIntegratedModeConfiguration=”false” />
</system.webServer>

</configuration>

That will be all! Wasn’t that easy? Start using your bin deployed assembly in your website. Also note that .NET is full trust by default in our servers which will allow you to load any assembly that needs full trust as well from bin folder.

Looking for quality ASP.NET Hosting? Look no further than Arvixe Web Hosting!

Tags: , , , , , , | Posted under DotNet/Windows Hosting, Windows Server Admin | RSS 2.0

3 Comments on How to Bin Deploy ASP.NET Assemblies on Shared Servers

  1. Bob Anderson says:

    Very helpful Blog . Do you have any actual examples for Changing the web.config file

Leave a Reply

Your email address will not be published. Required fields are marked *


1 + 1 =

You may use these HTML tags and attributes: <a href="" title="" rel=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>