On Mar 29, 2013, at 10:14 PM, Alex Rønne Petersen <[email protected]> wrote:
> The issue is, of course, that the interpretation of the name is ambiguous.

The real issue is one of semantics.

Here's the scenario: You have a path to an assembly ("/Conference/Advanced, Day 
1, First Half/Demo Name/bin/Debug/Assembly.dll").

Question: How should you get an AssemblyNameReference from the assembly?

The (broken?) assumption in some parts of our code was that 
AssemblyNameReference.Parse(path) would Do The Right Thing (for some variation 
of "right"), but this does not in fact work ("path has commas in it causes 
things to go kablooie").

I suspect that the "proper" solution is:

        AssemblyDefinition def = AssemblyDefinition.ReadAssembly (path);
        AssemblyNameReference name = def.Name;

This has the unfortunate requirement that the file needs to be read to 
determine what the name is, which makes it hard to have a cache of 
AssemblyNameReferences to avoid opening and reading assemblies... Meaning 
there's no point in having a cache of AssemblyNameReference > 
AssemblyDefinition; instead you'd want Path > AssemblyDefinition. And if two 
different paths have the same AssemblyNameReference (e.g. double 
reference)...that'll need to be validated/prevented.

 - Jon

-- 
-- 
--
mono-cecil
--- 
You received this message because you are subscribed to the Google Groups 
"mono-cecil" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to