api-doc-tools icon indicating copy to clipboard operation
api-doc-tools copied to clipboard

First-chance exception in MonoDevelop (monodoc.xml not found)

Open KirillOsenkov opened this issue 8 years ago • 1 comments

https://github.com/mono/monodevelop is using this build of monodoc:

commit eab22f0e69b7168631b63b1469005fe5b3ee13cb
Author: Jérémie Laval <[email protected]>
Date:   Thu May 9 12:18:37 2013 -0400

    [macdoc] Bump bundled monodoc.dll to mono/mono@245dee37992a827b99b9cb9df36cf78ce65db454

At startup of MonoDevelop we see this first-chance exception:

 mscorlib.dll!System.IO.__Error.WinIOError Line 145    C#
     mscorlib.dll!System.IO.FileStream.Init Line 880    C#
     mscorlib.dll!System.IO.FileStream.FileStream Line 535    C#
     System.Xml.dll!System.Xml.XmlDownloadManager.GetStream Line 30    C#
     System.Xml.dll!System.Xml.XmlUrlResolver.GetEntity Line 61    C#
     System.Xml.dll!System.Xml.XmlTextReaderImpl.OpenUrlDelegate Line 2847    C#
     mscorlib.dll!System.Threading.CompressedStack.runTryCode Line 313    C#
     [Native to Managed Transition]    
     [Managed to Native Transition]    
     mscorlib.dll!System.Threading.CompressedStack.Run Line 290    C#
>    System.Xml.dll!System.Xml.XmlTextReaderImpl.OpenUrl Line 2830    C#
     System.Xml.dll!System.Xml.XmlTextReaderImpl.Read Line 1179    C#
     System.Xml.dll!System.Xml.XmlLoader.Load Line 45    C#
     System.Xml.dll!System.Xml.XmlDocument.Load Line 1108    C#
     System.Xml.dll!System.Xml.XmlDocument.Load Line 1069    C#
     monodoc.dll!Monodoc.RootTree.LoadTree    Unknown
     monodoc.dll!Monodoc.RootTree.LoadTree    Unknown
     MonoDevelop.Core.dll!MonoDevelop.Projects.HelpService.InitializeHelpTree Line 72    C#
     MonoDevelop.Core.dll!MonoDevelop.Projects.HelpService.AsyncInitialize.AnonymousMethod__4_0 Line 57    C#

Because C:\monodevelop\main\build\bin\monodoc.xml was not found.

Since we don't have good symbols for that build it's hard to see if RootTree.LoadTree should have an early out if the file doesn't exist. Also this might have been already fixed since 2013.

Tagging @garuma to see if we should update to a newer build of monodoc in monodevelop.

In the monodevelop repo, it is found in 3 places:

C:\monodevelop\main\external\macdoc\lib\monodoc.dll
C:\monodevelop\main\external\mono-tools\windoc\WinDoc\lib\monodoc.dll
C:\monodevelop\main\external\monomac\samples\macdoc\lib\monodoc.dll

Not sure which one is the one that should be updated.

KirillOsenkov avatar May 05 '17 00:05 KirillOsenkov

The method in question definitely assumes that this file exists, as it is from this configuration file that the help tree is configured and loaded:
https://github.com/mono/api-doc-tools/blob/master/monodoc/Monodoc/RootTree.cs#L85

However, the method above should simply pass a null XmlDocument if that file doesn't exist, because if that were to happen, monodoc would bootstrap with the embedded monodoc.xml:
https://github.com/mono/api-doc-tools/blob/master/monodoc/Monodoc/RootTree.cs#L114

In the short term, could you simply include a copy of monodoc.xml as a resource that gets deployed on build? Otherwise, this will definitely be improved in a future build/release

joelmartinez avatar May 08 '17 14:05 joelmartinez