-
Notifications
You must be signed in to change notification settings - Fork 0
/
Assembly-name.htm
56 lines (49 loc) · 2.18 KB
/
Assembly-name.htm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<!DOCTYPE html>
<html>
<head>
<meta charset="utf8" />
<title>Assembly name</title>
</head>
<body>
<table><tr><td style="vertical-align:top;">
<h1>Assembly name</h1>
</td><td style="vertical-align:top;">
<a href="index.htm">Gentoo Mono Handbook</a>
<br />
</td></tr></table>
<a href="http://stackoverflow.com/questions/1410312/parsing-assembly-qualified-name">http://stackoverflow.com/questions/1410312/parsing-assembly-qualified-name</a>
<br />
<br />
There is a parser implementation in <a href="https://github.com/mono/mono/blob/master/mcs/class/corlib/System/TypeSpec.cs">Mono</a> and <a href="http://msdn.microsoft.com/en-us/library/yfsftwz6.aspx">BNF grammar on MSDN</a>
<br />
<br />
<pre>
AssemblyNameSpec := IDENTIFIER
| IDENTIFIER ',' AssemblyProperties
AssemblyProperties := AssemblyProperty
| AssemblyProperties ',' AssemblyProperty
AssemblyProperty := AssemblyPropertyName '=' AssemblyPropertyValue
</pre>
<br />
<br />
The AssemblyName class can parse the assembly name for you, just pass in the string to its constructor.
<br />
Stripping the name is usually very complex.
<br />
Consider even simple Tuple<int,string>:
<br />
"System.Tuple`2[[System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
<br />
AssemblyName constructor throws FileLoadException unless it's able to load the assembly
<br />
<br />
Func<AssemblyName, Assembly> assemblyResolver
<br />
<br />
<a href="http://stackoverflow.com/questions/4085613/parse-assembly-qualified-name-without-using-assemblyname">http://stackoverflow.com/questions/4085613/parse-assembly-qualified-name-without-using-assemblyname</a>
<br />
<br />
<a href="https://github.com/jbevain/cecil/blob/master/Mono.Cecil/AssemblyNameReference.cs">https://github.com/jbevain/cecil/blob/master/Mono.Cecil/AssemblyNameReference.cs</a>
</body>
</html>