How to use two versions of the same assembly in an ASP.NET application?

I have an old version of the asp.net component . I would like to use a newer version along with the old version.

I installed both assemblies in the GAC using the command gacutil.exe. Now I would like to download a specific version of the component on each page .aspx.

How can i do this?

Can i use this code?

<%@ Register assembly="<dllname>, Version=2.5.0.0, Culture=neutral,
    PublicKeyToken=......." Namespace="<dllNamespace>." TagPrefix="WG" %>
+3
source share
2 answers

You can use create the version object you want at runtime using the following code

  Object obj = Activator.CreateInstance("dllName","dllNameSpace.ClassName");

Activator.CreateInstance Activator.CreateInstance

0

, , Register, . , .

, , usercontrols, . , : controls_for_1_5 controls_for_2_5, . (, , ). - , Can't cast 'Namespace.ClassA' to 'Namespace.ClassA' (, , ), .

, , , .NET.

0

All Articles