<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">



<div style="direction: ltr;font-family: Tahoma;color: #000000;font-size: 10pt;">
<p>That's quite a difference. It must be there for compatibility now if that is the case because it is nothing but a string compare and does not really justify a function with that name. Also it would be a breaking problem if you were expecting the behavior
 described in the 2.0 docs.. </p>
<p> </p>
<div style="FONT-SIZE: 16px; FONT-FAMILY: Times New Roman; COLOR: #000000">
<hr tabindex="-1">
<div id="divRpF13963" style="DIRECTION: ltr"><font color="#000000" size="2" face="Tahoma"><b>From:</b> Daniel Lo Nigro [via Mono] [ml-node+<a href="/user/SendEmail.jtp?type=node&node=4660694&i=0" target="_top" rel="nofollow" link="external">[hidden email]</a>]<br>
<b>Sent:</b> Tuesday, August 27, 2013 8:00 PM<br>
<b>To:</b> Mark Lintner<br>
<b>Subject:</b> Re: A possible implementation for AssemblyName.ReferenceMatchesDefinition<br>
</font><br>
</div>
<div></div>
<div>
<div dir="ltr">It looks like the behaviour may have changed between .NET versions... The MSDN page for .NET Framework 3.5 onwards (including 4.5) states:
<div><br>
</div>
<blockquote style='border-left:2px solid #CCCCCC;padding:0 1em' class="gmail_quote" style="PADDING-BOTTOM: 0px; PADDING-TOP: 0px; PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid; PADDING-RIGHT: 1em">
Returns a value indicating whether two assembly names are the same. The comparison is based on the simple assembly names.<br>
return value - true if the simple assembly names are the same; otherwise, false.<br>
The comparison depends only on the simple assembly name. It ignores version, culture, and public key token.</blockquote>
<div><br>
</div>
<div>But the <a href="http://msdn.microsoft.com/en-us/library/system.reflection.assemblyname.referencematchesdefinition(v=vs.80).aspx" rel="nofollow" target="_blank" link="external">
.NET Framework 2.0 page</a> states:</div>
<div><br>
</div>
<blockquote style='border-left:2px solid #CCCCCC;padding:0 1em' class="gmail_quote" style="PADDING-BOTTOM: 0px; PADDING-TOP: 0px; PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid; PADDING-RIGHT: 1em">
Returns a value indicating whether the loader resolves two assembly names to the same assembly.<br>
Return Value - true if the loader resolves definition to the same assembly as reference; otherwise, false.<br>
Both reference and definition are resolved by the loader, including policy evaluation, and then definition is tested for equality to reference.</blockquote>
<div><br>
</div>
<div>It sounds like it did a lot more work in the .NET 2.0 implementation. Not sure why it changed and I can't seem to find much information on it.</div>
<div><br>
</div>
</div>
<div class="gmail_extra"><br>
<br>
<div class="gmail_quote">On Wed, Aug 28, 2013 at 10:46 AM, mlgo <span dir="ltr"><<a href="https://connect.emailsrvr.com/owa/UrlBlockedError.aspx" rel="nofollow" target="_blank" link="external">[hidden email]</a>></span> wrote:<br>
<blockquote style='border-left:2px solid #CCCCCC;padding:0 1em' class="gmail_quote" style="PADDING-BOTTOM: 0px; PADDING-TOP: 0px; PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid; PADDING-RIGHT: 1em">
<div style="FONT-SIZE: 10pt; FONT-FAMILY: Tahoma; DIRECTION: ltr">
<p>Right. Thanks. I hadn't thought about that. I keep suspecting that the documentation is not right though. That in fact what needs to be done is determine if the names actually refer to the same dll. Hopefully someone can reply to this who knows more about
 the internals of this. Otherwise I need to find some more real world uses of it in dotnet source code so I can better understand if this is the right way to go.
</p>
<hr>
<p></p>
<div style="FONT-SIZE: 16px; FONT-FAMILY: Times New Roman">
<div style="DIRECTION: ltr"><font color="#000000" face="Tahoma"><b>From:</b> Daniel Lo Nigro [via Mono] [ml-node+<a href="http://user/SendEmail.jtp?type=node&node=4660692&i=0" rel="nofollow" target="_blank" link="external">[hidden email]</a>]<br>
<b>Sent:</b> Tuesday, August 27, 2013 7:20 PM<br>
<b>To:</b> Mark Lintner<br>
<b>Subject:</b> Re: A possible implementation for AssemblyName.ReferenceMatchesDefinition<br>
</font><br>
</div>
<div></div>
<div>
<div class="im">
<div dir="ltr">You may want to ignore culture and case in your comparison:
<div><br>
</div>
<div><font face="courier new, monospace">return reference.Name.Equals(definition.Name, StringComparison.InvariantCultureIgnoreCase)</font></div>
<div><br>
</div>
</div>
</div>
<div class="gmail_extra"><br>
<br>
<div class="gmail_quote">
<div class="im">On Wed, Aug 28, 2013 at 1:29 AM, mlgo <span dir="ltr"><<a href="https://connect.emailsrvr.com/owa/UrlBlockedError.aspx" rel="nofollow" target="_blank" link="external">[hidden email]</a>></span> wrote:<br>
</div>
<blockquote style='border-left:2px solid #CCCCCC;padding:0 1em' class="gmail_quote" style="PADDING-BOTTOM: 0px; PADDING-TOP: 0px; PADDING-LEFT: 1em; BORDER-LEFT: #cccccc 2px solid; PADDING-RIGHT: 1em">
<div class="im">According to<br>
<a href="http://msdn.microsoft.com/en-us/library/system.reflection.assemblyname.referencematchesdefinition.aspx" rel="nofollow" target="_blank" link="external">http://msdn.microsoft.com/en-us/library/system.reflection.assemblyname.referencematchesdefinition.aspx</a><br>
<br>
The following is what is expected to be returned from<br>
ReferenceMatchesDefinition.<br>
<br>
Returns a value indicating whether two assembly names are the same. The<br>
comparison is based on the simple assembly names.<br>
<br>
This seems na├»ve but below is a tentative implementation of that. Any ideas?<br>
<br>
public static bool ReferenceMatchesDefinition (AssemblyName reference,<br>
AssemblyName definition)<br>
                {<br>
                        if (reference == null)<br>
                                throw new ArgumentNullException ("reference");<br>
                        if (definition == null)<br>
                                throw new ArgumentNullException ("definition");<br>
                        if (reference.Name != definition.Name)<br>
                                return false;<br>
<br>
                        return reference.Name.Equals(definition.Name);<br>
                }<br>
<br>
<br>
<br>
<br>
--<br>
View this message in context: <a href="http://mono.1490590.n4.nabble.com/A-possible-implementation-for-AssemblyName-ReferenceMatchesDefinition-tp4660683.html" rel="nofollow" target="_blank" link="external">
http://mono.1490590.n4.nabble.com/A-possible-implementation-for-AssemblyName-ReferenceMatchesDefinition-tp4660683.html</a><br>
Sent from the Mono - Dev mailing list archive at Nabble.com.<br>
_______________________________________________<br>
Mono-devel-list mailing list<br>
</div>
<a href="https://connect.emailsrvr.com/owa/UrlBlockedError.aspx" rel="nofollow" target="_blank" link="external">[hidden email]</a><br>
<a href="http://lists.ximian.com/mailman/listinfo/mono-devel-list" rel="nofollow" target="_blank" link="external">http://lists.ximian.com/mailman/listinfo/mono-devel-list</a><br>
</blockquote>
</div>
<br>
</div>
<br>
_______________________________________________ <br>
Mono-devel-list mailing list <br>
<a href="https://connect.emailsrvr.com/owa/UrlBlockedError.aspx" rel="nofollow" target="_blank" link="external">[hidden email]</a>
<br>
<a href="http://lists.ximian.com/mailman/listinfo/mono-devel-list" rel="nofollow" target="_blank" link="external">http://lists.ximian.com/mailman/listinfo/mono-devel-list</a><br>
<br>
<br>
<hr color="#cccccc" size="1" noshade="">
<div style="COLOR: #444; FONT: 12px tahoma,geneva,helvetica,arial,sans-serif">
<div style="FONT-WEIGHT: bold">If you reply to this email, your message will be added to the discussion below:</div>
<a href="http://mono.1490590.n4.nabble.com/A-possible-implementation-for-AssemblyName-ReferenceMatchesDefinition-tp4660683p4660691.html" rel="nofollow" target="_blank" link="external">http://mono.1490590.n4.nabble.com/A-possible-implementation-for-AssemblyName-ReferenceMatchesDefinition-tp4660683p4660691.html</a>
</div>
<div style="COLOR: #666; FONT: 11px/1.5em tahoma,geneva,helvetica,arial,sans-serif; MARGIN-TOP: 0.4em">
To unsubscribe from A possible implementation for AssemblyName.ReferenceMatchesDefinition,
<a rel="nofollow" target="_top" link="external">click here</a>.<br>
<a style="FONT: 9px serif" href="http://mono.1490590.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml" rel="nofollow" target="_blank" link="external">NAML</a>
</div>
</div>
</div>
</div>
<br>
<hr align="left" width="300">
View this message in context: <a href="http://mono.1490590.n4.nabble.com/A-possible-implementation-for-AssemblyName-ReferenceMatchesDefinition-tp4660683p4660692.html" rel="nofollow" target="_blank" link="external">
RE: A possible implementation for AssemblyName.ReferenceMatchesDefinition</a>
<div class="HOEnZb">
<div class="h5"><br>
Sent from the <a href="http://mono.1490590.n4.nabble.com/Mono-Dev-f1517221.html" rel="nofollow" target="_blank" link="external">
Mono - Dev mailing list archive</a> at Nabble.com.<br>
</div>
</div>
<br>
_______________________________________________<br>
Mono-devel-list mailing list<br>
<a href="https://connect.emailsrvr.com/owa/UrlBlockedError.aspx" rel="nofollow" target="_blank" link="external">[hidden email]</a><br>
<a href="http://lists.ximian.com/mailman/listinfo/mono-devel-list" rel="nofollow" target="_blank" link="external">http://lists.ximian.com/mailman/listinfo/mono-devel-list</a><br>
<br>
</blockquote>
</div>
<br>
</div>
<br>
_______________________________________________ <br>
Mono-devel-list mailing list <br>
<a href="https://connect.emailsrvr.com/owa/UrlBlockedError.aspx" rel="nofollow" target="_blank" link="external">[hidden email]</a>
<br>
<a href="http://lists.ximian.com/mailman/listinfo/mono-devel-list" rel="nofollow" target="_blank" link="external">http://lists.ximian.com/mailman/listinfo/mono-devel-list</a><br>
<br>
<br>
<hr color="#cccccc" size="1" noshade="">
<div style="COLOR: #444; FONT: 12px tahoma,geneva,helvetica,arial,sans-serif">
<div style="FONT-WEIGHT: bold">If you reply to this email, your message will be added to the discussion below:</div>
<a href="http://mono.1490590.n4.nabble.com/A-possible-implementation-for-AssemblyName-ReferenceMatchesDefinition-tp4660683p4660693.html" target="_blank" rel="nofollow" link="external">http://mono.1490590.n4.nabble.com/A-possible-implementation-for-AssemblyName-ReferenceMatchesDefinition-tp4660683p4660693.html</a>
</div>
<div style="COLOR: #666; FONT: 11px/1.5em tahoma,geneva,helvetica,arial,sans-serif; MARGIN-TOP: 0.4em">
To unsubscribe from A possible implementation for AssemblyName.ReferenceMatchesDefinition,
<a href="" target="_blank" rel="nofollow" link="external">
click here</a>.<br>
<a style="FONT: 9px serif" href="http://mono.1490590.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml" rel="nofollow" target="_blank" link="external">NAML</a>
</div>
</div>
</div>
</div>




        
        
        
<br/><hr align="left" width="300" />
View this message in context: <a href="http://mono.1490590.n4.nabble.com/A-possible-implementation-for-AssemblyName-ReferenceMatchesDefinition-tp4660683p4660694.html">RE: A possible implementation for AssemblyName.ReferenceMatchesDefinition</a><br/>
Sent from the <a href="http://mono.1490590.n4.nabble.com/Mono-Dev-f1517221.html">Mono - Dev mailing list archive</a> at Nabble.com.<br/>