Unhandled Exception: System.FormatException

Topics: Developer Forum
Jan 25, 2007 at 7:16 PM
Before I complain - thanks to you guys for building this. The tool is awesome... but, I have run into an interesting problem.

An exception gets thrown when attempting to document a particular design pattern involving generics.

The design pattern is described like this:
ClassLibrary1 declares bar and ClassLibrary2 declares foo, defined below.

--- start code stuff ---
public class foo<FT>
{
public class foo_nested<FN> { }
}

public class bar<BT, FT>
{
public bar(foo<FT>.foo_nested<BT> arg){ }
}
--- start code stuff ---

The exception seems to be Microsoft's thing. I don't know if it's caused because of something I did, something within SHFB, or something within Microsoft's sandcastle libs.

--- start SHFB Log snip---
Info: BuildAssembler: Building topic N:ClassLibrary1
Info: BuildAssembler: Building topic T:ClassLibrary1.bar`2

Unhandled Exception: System.FormatException: Input string was not in a correct format.
at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal)
at System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info)
at System.Convert.ToInt32(String value)
at Microsoft.Ddue.Tools.ResolveReferenceLinksComponent.GetTemplateParameterName(String reference, String context)
at Microsoft.Ddue.Tools.ResolveReferenceLinksComponent.WriteTypeReference(String reference, Boolean showContainer, Boolean showTemplates, String context, XmlWriter writer)
at Microsoft.Ddue.Tools.ResolveReferenceLinksComponent.WriteTypeReference(String reference, Boolean showContainer, Boolean showTemplates, String context, XmlWriter writer)
at Microsoft.Ddue.Tools.ResolveReferenceLinksComponent.WriteMethodReference(String id, Boolean showContainer, Boolean showTemplates, Boolean showParameters, String context, XmlWriter writer)
at Microsoft.Ddue.Tools.ResolveReferenceLinksComponent.WriteReferenceTitle(String target, Boolean showContainer, Boolean showTemplates, Boolean showParameters, String context, XmlWriter writer)
at Microsoft.Ddue.Tools.ResolveReferenceLinksComponent.Apply(XmlDocument document, String key)
at Microsoft.Ddue.Tools.BuildAssembler.Apply(IEnumerable`1 manifest)
at Microsoft.Ddue.Tools.BuildAssembler.Apply(String manifestFile)
at Microsoft.Ddue.Tools.BuildAssemblerConsole.Main(String[] args)


BUILD FAILED: Unexpected error in last build step. See output above for details.
--- end SHFB Log snip---

I can provide a VStudio2005 solution and .shfb in a zip file. I'm new here, and I'm not sure about the etiquette for filing bugs (and I wasn't sure what to put for some of the fields either). If I should file an issue, I can do that and upload a zip file.

Also, fixing this bug is very important to me. If I can assist in any way to getting it fixed (including contributing a fix), then I'm happy to do so.
Jan 25, 2007 at 7:38 PM
I did find a partial workaround by changing the typeparams of bar.

public class bar<X, BT, FT> where X: foo<FT>.foo_nested<BT>
{
public bar(X arg) { }
}

Unfortunately, problems still exists if foo_nested is changed to a delegate. In that case, code won't even compile because I can't
use a delegate type as a type constraint for X.
Coordinator
Jan 25, 2007 at 7:41 PM
Since this is a Microsoft component that's failing and not the help file builder, post your message in the MSDN Documentation forum with the details. You can find a link to it in the help file builder's help file in the Links to Resources topic.

Eric