Skip to content

Commit 1822990

Browse files
authored
[MDocUpdater] Fix assembly info duplication (#638)
The `AssemblyPublicKey` and `AssemblyCulture` elements will be added to to a docs `index.xml` file every time the tool runs, even if the element already exists. Fix this by using `MDocUpdater.WriteElement` to write these elements, as it will first check for an existing element rather than always creating a new one.
1 parent 039a030 commit 1822990

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

mdoc/Mono.Documentation/MDocUpdater.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -988,7 +988,7 @@ private void AddIndexAssembly (AssemblyDefinition assembly, XmlElement parent, F
988988
AssemblyNameDefinition name = assembly.Name;
989989
if (name.HasPublicKey)
990990
{
991-
XmlElement pubkey = parent.OwnerDocument.CreateElement ("AssemblyPublicKey");
991+
XmlElement pubkey = WriteElement (index_assembly, "AssemblyPublicKey");
992992
var key = new StringBuilder (name.PublicKey.Length * 3 + 2);
993993
key.Append ("[");
994994
foreach (byte b in name.PublicKey)
@@ -1000,7 +1000,7 @@ private void AddIndexAssembly (AssemblyDefinition assembly, XmlElement parent, F
10001000

10011001
if (!string.IsNullOrEmpty (name.Culture))
10021002
{
1003-
XmlElement culture = parent.OwnerDocument.CreateElement ("AssemblyCulture");
1003+
XmlElement culture = WriteElement (index_assembly, "AssemblyCulture");
10041004
culture.InnerText = name.Culture;
10051005
index_assembly.AppendChild (culture);
10061006
}

0 commit comments

Comments
 (0)