Long time lurker, first time poster.
Background: I have an asp.net webforms application that currently references a third party assembly that contains various web controls. The third party controls are sometimes used directly on various pages or are part of user controls that are used else where. The application also makes use of custom server controls that extend various third party controls as well. These custom controls are also used in a similar manner.
Reference(s): Related Post, There are several more that discuss multiple versions of an assembly, but nothing i found where the assemblies referenced contained webcontrols.
Problem: Its been discovered that one of the third party controls has an issue with IE10. The issue is addressed in the latest version of the third party assembly. However I cannot fully upgrade the entire application to the latest version of the third party assembly.
Question: Is it possible to run two versions of the third party assembly side by side?
Research: I have taken the assembly binding approach as mentioned in several other posts regarding multiple versions of the same assembly:
<dependentAssembly>
<assemblyIdentity name="thirdParty" publicKeyToken="XXX"/>
<codeBase version="OldVersion" href="bin"/>
<codeBase version="NewVersion" href="2013/ThirdParty.dll"/>
</dependentAssembly>
</assemblyBinding>
I've also referenced both assemblies in the project file and alias the new version of the assembly:
<Reference Include="ThirdParty, Version=OldVersion, Culture=neutral, PublicKeyToken=XXX, processorArchitecture=MSIL">
<SpecificVersion>True</SpecificVersion>
<HintPath>..\..\Library\ThirdParty.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="ThirdParty, Version=NewVersion, Culture=neutral, PublicKeyToken=XXX, processorArchitecture=MSIL">
<SpecificVersion>True</SpecificVersion>
<HintPath>2013\ThirdParty.dll</HintPath>
<Private>False</Private>
<Aliases>newVersion</Aliases>
</Reference>
In the target user control that I want to use the new version of the controls, I have the following markup:
<%@Assembly Name="ThirdParty, Version=NewVersion, Culture=neutral, PublicKeyToken=XXX" %>
<%@Register tagPrefix="2013" namespace="ThirdPartyNamespace" Assembly="ThirdParty, Version=NewVersion, Culture=neutral, PublicKeyToken=XXX" %>
In the designer codebehind i have the following (newVersion is the alias assigned to the reference above):
extern alias newVersion;
protected newVersion::ThirdParty.ControlName cbRangeType;
Everything builds and runs until I get to the portion where the asp.net compiler is parsing the markup. It fails with the CS0433 error. Which pretty much indicates that type of cbRangeType control exists in two different places.
\AppData\Local\Temp\Temporary ASP.NET Files\root\9f04cc99\85cc721e\assembly\dl3\5dc4ef04\77c80123_27b9ce01\ThirdParty.DLL
\WebSites\Site\2013\ThirdParty.dll'
Looking at the generated code, I see that the control type is not using the newVersion alias, but the default global alias:
Line 348: [System.Diagnostics.DebuggerNonUserCodeAttribute()]
Line 349: private global::ThirdParty.ControlName @__BuildControlcbRangeType() {
Line 350: global::ThirdParty.ControlName @__ctrl;
Is it even possible for me to override whats generated by the call to BuildControl() at the user control level? Is what I am attempting to do even possible? Thanks in advance.
Regards, Noobian