Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception thrown when Xml String contains XML #15

Open
nikkilocke opened this issue Aug 11, 2017 · 2 comments
Open

Exception thrown when Xml String contains XML #15

nikkilocke opened this issue Aug 11, 2017 · 2 comments
Labels

Comments

@nikkilocke
Copy link

I added XmlCommentMarkdownGenerator to my project from NuGet, and ran a compile. The output was:

1>Unhandled Exception: System.Xml.XmlException: Unknown element type "input" ---> System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
1>   at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
1>   at PxtlCa.XmlCommentMarkDownGenerator.XmlToMarkdown.ToMarkDown(XNode node, String assemblyName)
1>   --- End of inner exception stack trace ---
1>   at PxtlCa.XmlCommentMarkDownGenerator.XmlToMarkdown.ToMarkDown(XNode node, String assemblyName)
1>   at PxtlCa.XmlCommentMarkDownGenerator.XmlToMarkdown.<>c__DisplayClass7_0.<ToMarkDown>b__0(String current, XNode x)
1>   at System.Linq.Enumerable.Aggregate[TSource,TAccumulate](IEnumerable`1 source, TAccumulate seed, Func`3 func)
1>   at PxtlCa.XmlCommentMarkDownGenerator.XmlToMarkdown.ToMarkDown(IEnumerable`1 es, String assemblyName)
1>   at PxtlCa.XmlCommentMarkDownGenerator.TagRenderer.<>c.<.cctor>b__8_6(XElement x, String assemblyName)
1>   at PxtlCa.XmlCommentMarkDownGenerator.XmlToMarkdown.ToMarkDown(XNode node, String assemblyName)
1>   at PxtlCa.XmlCommentMarkDownGenerator.XmlToMarkdown.<>c__DisplayClass7_0.<ToMarkDown>b__0(String current, XNode x)
1>   at System.Linq.Enumerable.Aggregate[TSource,TAccumulate](IEnumerable`1 source, TAccumulate seed, Func`3 func)
1>   at PxtlCa.XmlCommentMarkDownGenerator.XmlToMarkdown.ToMarkDown(IEnumerable`1 es, String assemblyName)
1>   at PxtlCa.XmlCommentMarkDownGenerator.XmlToMarkdown.ExtractNameAndBodyFromMember(XElement node, String assemblyName)
1>   at PxtlCa.XmlCommentMarkDownGenerator.TagRenderer.<>c.<.cctor>b__8_1(XElement x, String assemblyName)
1>   at PxtlCa.XmlCommentMarkDownGenerator.XmlToMarkdown.ToMarkDown(XNode node, String assemblyName)
1>   at PxtlCa.XmlCommentMarkDownGenerator.XmlToMarkdown.<>c__DisplayClass7_0.<ToMarkDown>b__0(String current, XNode x)
1>   at System.Linq.Enumerable.Aggregate[TSource,TAccumulate](IEnumerable`1 source, TAccumulate seed, Func`3 func)
1>   at PxtlCa.XmlCommentMarkDownGenerator.XmlToMarkdown.ToMarkDown(IEnumerable`1 es, String assemblyName)
1>   at PxtlCa.XmlCommentMarkDownGenerator.TagRenderer.<>c.<.cctor>b__8_0(XElement x, String assemblyName)
1>   at PxtlCa.XmlCommentMarkDownGenerator.XmlToMarkdown.ToMarkDown(XNode node, String assemblyName)
1>   at PxtlCa.XmlCommentMarkDownGenerator.Program.Main(String[] args)
1>C:\Users\Nikki\.nuget\packages\pxtlca.xmlcommentmarkdowngenerator\0.2.6270.2853\build\PxtlCa.XmlCommentMarkDownGenerator.targets(10,5): error MSB3073: The command ""C:\Users\Nikki\.nuget\packages\pxtlca.xmlcommentmarkdowngenerator\0.2.6270.2853\build\\..\Tools\PxtlCa.XmlCommentMarkDownGenerator.exe" -i "C:\Dev\CodeFirstWebFramework\bin\Debug\net45\\CodeFirstWebFramework.xml" -o "C:\Dev\CodeFirstWebFramework\..\Docs\CodeFirstWebFramework.GeneratedXmlDoc.md"" exited with code 255.
@nikkilocke
Copy link
Author

Further to this, it was caused because I inadvertently used some xml inside one of my comments:

/// <summary>
/// Class to hold details of an uploaded file (from an <input type="file" />)
/// </summary>

Perhaps you should treat unrecognised xml inside comments as plain text?

@Pxtl
Copy link
Owner

Pxtl commented Aug 16, 2017

Good find. I'll see if I can fix this. If I don't get to it, patches are welcome.

@Pxtl Pxtl changed the title Exception thrown when building project Exception thrown when Xml String contains XML Aug 16, 2017
@Pxtl Pxtl added the bug label Aug 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants