[Mono-dev] A possible implementation for AssemblyName.ReferenceMatchesDefinition
mlgo
mlintner at sinenomine.net
Wed Aug 28 00:46:05 UTC 2013
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.
________________________________
From: Daniel Lo Nigro [via Mono] [ml-node+s1490590n4660691h6 at n4.nabble.com]
Sent: Tuesday, August 27, 2013 7:20 PM
To: Mark Lintner
Subject: Re: A possible implementation for AssemblyName.ReferenceMatchesDefinition
You may want to ignore culture and case in your comparison:
return reference.Name.Equals(definition.Name, StringComparison.InvariantCultureIgnoreCase)
On Wed, Aug 28, 2013 at 1:29 AM, mlgo <[hidden email]<https://connect.emailsrvr.com/owa/UrlBlockedError.aspx>> wrote:
According to
http://msdn.microsoft.com/en-us/library/system.reflection.assemblyname.referencematchesdefinition.aspx
The following is what is expected to be returned from
ReferenceMatchesDefinition.
Returns a value indicating whether two assembly names are the same. The
comparison is based on the simple assembly names.
This seems naïve but below is a tentative implementation of that. Any ideas?
public static bool ReferenceMatchesDefinition (AssemblyName reference,
AssemblyName definition)
{
if (reference == null)
throw new ArgumentNullException ("reference");
if (definition == null)
throw new ArgumentNullException ("definition");
if (reference.Name != definition.Name)
return false;
return reference.Name.Equals(definition.Name);
}
--
View this message in context: http://mono.1490590.n4.nabble.com/A-possible-implementation-for-AssemblyName-ReferenceMatchesDefinition-tp4660683.html
Sent from the Mono - Dev mailing list archive at Nabble.com.
_______________________________________________
Mono-devel-list mailing list
[hidden email]<https://connect.emailsrvr.com/owa/UrlBlockedError.aspx>
http://lists.ximian.com/mailman/listinfo/mono-devel-list
_______________________________________________
Mono-devel-list mailing list
[hidden email]<https://connect.emailsrvr.com/owa/UrlBlockedError.aspx>
http://lists.ximian.com/mailman/listinfo/mono-devel-list
________________________________
If you reply to this email, your message will be added to the discussion below:
http://mono.1490590.n4.nabble.com/A-possible-implementation-for-AssemblyName-ReferenceMatchesDefinition-tp4660683p4660691.html
To unsubscribe from A possible implementation for AssemblyName.ReferenceMatchesDefinition, click here<http://mono.1490590.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=4660683&code=bWxpbnRuZXJAc2luZW5vbWluZS5uZXR8NDY2MDY4M3w2OTQwNjY1ODM=>.
NAML<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>
--
View this message in context: http://mono.1490590.n4.nabble.com/A-possible-implementation-for-AssemblyName-ReferenceMatchesDefinition-tp4660683p4660692.html
Sent from the Mono - Dev mailing list archive at Nabble.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ximian.com/pipermail/mono-devel-list/attachments/20130827/f07d743b/attachment.html>
More information about the Mono-devel-list
mailing list