[Mono-bugs] [Bug 580185] New: assembly version redirection fails to work properly
bugzilla_noreply at novell.com
bugzilla_noreply at novell.com
Tue Feb 16 08:29:04 EST 2010
http://bugzilla.novell.com/show_bug.cgi?id=580185
http://bugzilla.novell.com/show_bug.cgi?id=580185#c0
Summary: assembly version redirection fails to work properly
Classification: Mono
Product: Mono: Runtime
Version: unspecified
Platform: Other
OS/Version: Other
Status: NEW
Severity: Normal
Priority: P5 - None
Component: misc
AssignedTo: mono-bugs at lists.ximian.com
ReportedBy: mhabersack at novell.com
QAContact: mono-bugs at lists.ximian.com
Found By: Community User
Blocker: ---
Created an attachment (id=342647)
--> (http://bugzilla.novell.com/attachment.cgi?id=342647)
extatica.zip
The attached test application results in the following error when run:
-----------------
System.InvalidCastException: Cannot cast from source type to destination type.
at System.Web.UI.ScriptManager.GetCurrent (System.Web.UI.Page page) [0x00011]
in
/home/src/build/mono/mcs/class/System.Web.Extensions/System.Web.UI/ScriptManager.cs:398
at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke
(System.Reflection.MonoMethod*,object,object[],System.Exception&)
at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags
invokeAttr, System.Reflection.Binder binder, System.Object[] parameters,
System.Globalization.CultureInfo culture) [0x000d0] in
/home/src/build/mono/mcs/class/corlib/System.Reflection/MonoMethod.cs:217
------------------
The attached application redirects System.Web.Extensions 1.0.61025.0 to
3.5.0.0:
-----------------
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Web.Extensions"
publicKeyToken="31bf3856ad364e35"/>
<bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
-----------------
The problem is this code from
System.Web.Extensions/System.Web.UI/ScriptManager.cs:
-----------------
public static ScriptManager GetCurrent (Page page) {
if (page == null)
throw new ArgumentNullException ("page");
return (ScriptManager) page.Items [ScriptManagerKey];
}
-----------------
Bin/ExtExtenders.dll references System.Web.Extensions 1.0.61025.0, while the
rest of the application is linked with System.Web.Extensions 3.5.0.0. The
method shown above, though, is loaded from the 1.0.61025.0 assembly and when
it's running, the following is true:
typeof (ScriptManager).AssemblyQualifiedName == System.Web.UI.ScriptManager,
System.Web.Extensions, Version=1.0.61025.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35
while the ScriptManager instance stored in page.Items comes from the 3.5.0.0
assembly:
page.Items [System.Web.UI.IScriptManager] == System.Web.UI.ScriptManager,
System.Web.Extensions, Version=3.5.0.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35
And therefore the cast fails. Runtime should never load any types from the
1.0.61025.0 version of the System.Web.Extensions assembly - they should be
redirected to their 3.5.0.0 counterparts. The workaround is to recompile the
Bin/ExtExtenders.dll assembly with System.Web.Extensions 3.5.0.0
The application works fine on .NET
--
Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.
More information about the mono-bugs
mailing list