Skip to content

Generating reference documentation fails for PCL Profile259 and System.IO #346

Closed
@adamchester

Description

@adamchester

Originally raised here: fsprojects/ProjectScaffold#211

I created a new blank ProjectScaffold, added an F# PCL (Profile259) Library (VS 2015), added member x.TestMe = new System.IO.StringWriter(), then executed build. It fails to build.

projectscaffoldpcldocfailure

I don't fully understand why, but it seems that F# Formatting doesn't know what to do with the PCL types... Do I need to add some references somewhere?

The relevant build error follows:

Generating 'C:\My\repo\TestPclScaffold\docs\tools\..\content/release-notes.html'
Help generated
Finished Target: GenerateHelp
Starting Target: GenerateReferenceDocs (==> RunTests, GenerateHelp)
FSharp.Formatting Information: 0 : FSharp.Formatting Logging setup!
Yaaf.FSharp.Scriping Information: 0 : Yaaf.FSharp.Scripting Logging setup!
Copying file: C:\My\repo\TestPclScaffold\docs\output\img\logo-template.pdn
Copying file: C:\My\repo\TestPclScaffold\docs\output\img\logo.png
Copying styles and scripts: C:\My\repo\TestPclScaffold\docs\output\content\style.css
Copying styles and scripts: C:\My\repo\TestPclScaffold\docs\output\content\style.css.bak
Copying styles and scripts: C:\My\repo\TestPclScaffold\docs\output\content\style_light.css
Copying styles and scripts: C:\My\repo\TestPclScaffold\docs\output\content\tips.js
Copying styles and scripts: C:\My\repo\TestPclScaffold\docs\output\content\img\github-blue.png
Copying styles and scripts: C:\My\repo\TestPclScaffold\docs\output\content\img\github.png
Creating C:\My\repo\TestPclScaffold\docs\output\reference
System.InvalidOperationException: The entity or value 'System.IO.StringWriter' does not exist or is in an unresolved assembly. You may need to add a reference to assembly 'System.IO'
   at Microsoft.FSharp.Compiler.SourceCodeServices.Impl.dflt@76[a](String asmName, String path) in C:\GitHub\fsharp\FSharp.Compiler.Service\src\fsharp\vs\Symbols.fs:line 37
   at Microsoft.FSharp.Compiler.SourceCodeServices.Impl.protect[a](FSharpFunc`2 f) in C:\GitHub\fsharp\FSharp.Compiler.Service\src\fsharp\vs\Symbols.fs:line 36
   at Microsoft.FSharp.Compiler.SourceCodeServices.FSharpEntity.get_MembersFunctionsAndValues() in C:\GitHub\fsharp\FSharp.Compiler.Service\src\fsharp\vs\Symbols.fs:line 416
   at FSharp.MetadataFormat.Reader.getMembers@889-1.GenerateNext(IEnumerable`1& next) in C:\Tomas\Public\tpetricek\FSharp.Formatting\src\FSharp.MetadataFormat\Main.fs:line 0
   at Microsoft.FSharp.Core.CompilerServices.GeneratedSequenceBase`1.MoveNextImpl()
   at Microsoft.FSharp.Core.CompilerServices.GeneratedSequenceBase`1.System-Collections-IEnumerator-MoveNext()
   at Microsoft.FSharp.Collections.SeqModule.ToList[T](IEnumerable`1 source)
   at FSharp.MetadataFormat.Reader.readType@885.Invoke(String cat, IDictionary`2 cmds, Comment comment) in C:\Tomas\Public\tpetricek\FSharp.Formatting\src\FSharp.MetadataFormat\Main.fs:line 900
   at FSharp.MetadataFormat.Reader.readCommentsInto[a](ReadingContext ctx, String xmlDoc, FSharpFunc`2 f) in C:\Tomas\Public\tpetricek\FSharp.Formatting\src\FSharp.MetadataFormat\Main.fs:line 790
   at FSharp.MetadataFormat.Reader.readType(ReadingContext ctx, FSharpEntity typ) in C:\Tomas\Public\tpetricek\FSharp.Formatting\src\FSharp.MetadataFormat\Main.fs:line 885
   at FSharp.MetadataFormat.Reader.readModulesAndTypes@878-2.Invoke(ReadingContext ctx, FSharpEntity typ) in C:\Tomas\Public\tpetricek\FSharp.Formatting\src\FSharp.MetadataFormat\Main.fs:line 878
   at Microsoft.FSharp.Collections.IEnumerator.choose@202.System-Collections-IEnumerator-MoveNext()
   at Microsoft.FSharp.Collections.SeqModule.ToList[T](IEnumerable`1 source)
   at FSharp.MetadataFormat.Reader.readModulesAndTypes(ReadingContext ctx, IEnumerable`1 entities) in C:\Tomas\Public\tpetricek\FSharp.Formatting\src\FSharp.MetadataFormat\Main.fs:line 879
   at FSharp.MetadataFormat.Reader.readNamespace(ReadingContext ctx, String ns, IEnumerable`1 entities) in C:\Tomas\Public\tpetricek\FSharp.Formatting\src\FSharp.MetadataFormat\Main.fs:line 957
   at FSharp.MetadataFormat.Reader.readAssembly@997-1.Invoke(Tuple`2 tupledArg) in C:\Tomas\Public\tpetricek\FSharp.Formatting\src\FSharp.MetadataFormat\Main.fs:line 997
   at Microsoft.FSharp.Collections.IEnumerator.map@111.DoMoveNext(b& )
   at Microsoft.FSharp.Collections.IEnumerator.MapEnumerator`1.System-Collections-IEnumerator-MoveNext()
   at Microsoft.FSharp.Collections.SeqModule.ToList[T](IEnumerable`1 source)
   at FSharp.MetadataFormat.Reader.readAssembly(FSharpAssembly assembly, Boolean publicOnly, String xmlFile, FSharpOption`1 sourceFolderRepo, FSharpFunc`2 urlRangeHighlight, Boolean markDownComments, IUrlHolder urlMap, String codeFormatCompilerArgs) in C:\Tomas\Public\tpetricek\FSharp.Formatting\src\FSharp.MetadataFormat\Main.fs:line 1000
   at <StartupCode$FSharp-MetadataFormat>.$Main.assemblies@1118-2.Invoke(Tuple`2 _arg2) in C:\Tomas\Public\tpetricek\FSharp.Formatting\src\FSharp.MetadataFormat\Main.fs:line 1123
   at Microsoft.FSharp.Collections.ListModule.chooseAllAcc[a,b](FSharpFunc`2 f, FSharpList`1 xs, FSharpList`1 acc)
   at FSharp.MetadataFormat.MetadataFormat.Generate(FSharpList`1 dllFiles, String outDir, FSharpList`1 layoutRoots, FSharpOption`1 parameters, FSharpOption`1 namespaceTemplate, FSharpOption`1 moduleTemplate, FSharpOption`1 typeTemplate, FSharpOption`1 xmlFile, FSharpOption`1 sourceRepo, FSharpOption`1 sourceFolder, FSharpOption`1 publicOnly, FSharpOption`1 libDirs, FSharpOption`1 otherFlags, FSharpOption`1 markDownComments, FSharpOption`1 urlRangeHighlight, FSharpOption`1 assemblyReferences) in C:\Tomas\Public\tpetricek\FSharp.Formatting\src\FSharp.MetadataFormat\Main.fs:line 1118
   at <StartupCode$FSI_0003>.$FSI_0003.main@() in C:\My\repo\TestPclScaffold\docs\tools\generate.fsx:line 140
Stopped due to error
Running build failed.
Error:
System.Exception: generating reference documentation failed
   at FSI_0001.Build.clo@185-19.Invoke(Unit _arg11)
   at Fake.TargetHelper.runSingleTarget(TargetTemplate`1 target) in C:\code\fake\src\app\FakeLib\TargetHelper.fs:line 483

---------------------------------------------------------------------
Build Time Report
---------------------------------------------------------------------
Target         Duration
------         --------
Clean          00:00:00.0067298
AssemblyInfo   00:00:00.0190892
Build          00:00:01.5366830
CopyBinaries   00:00:00.0193597
RunTests       00:00:01.2451498
CleanDocs      00:00:00.0105662
GenerateHelp   00:00:05.8688994
Total:         00:00:13.2202441
Status:        Failure
---------------------------------------------------------------------
  1) System.Exception: generating reference documentation failed
   at FSI_0001.Build.clo@185-19.Invoke(Unit _arg11)
   at Fake.TargetHelper.runSingleTarget(TargetTemplate`1 target) in C:\code\fake\src\app\FakeLib\TargetHelper.fs:line 483
---------------------------------------------------------------------

C:\My\repo\TestPclScaffold>

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions