Cannot generate documents for projects targeting Framework 4.5 and using specific 4.5 features
I'm working on a project that targets .NET framework 4.5 and uses specific 4.5 features/objects, like IReadOnlyDictionary<K,T>. When I run build.cmd ReleaseDocs on the dll resulting from compilation the generator crashes (stack trace reported below). If I substitute IReadOnlyDictionary with a simple Dictionary and leave 4.5 as target framework, the docs generation run fine, as well as I change the target framework to 4.0. It is very likely an issue of FSharp.Formatting. I'll try to checkout the latest version and determine if it has been corrected since the release of the version used by ProjectScaffold.
Generating 'index.html'
Generating 'tutorial.html'
Creating C:\Users\gabriele\Desktop\ProjectScaffold\docs\output\reference
[0 sec] Reading assembly: C:\Users\gabriele\Desktop\ProjectScaffold\docs\tools../../bin\FSCL.Compiler.dll
[0 sec] Parsing assembly
Microsoft.FSharp.Compiler.ErrorLogger+ReportedError: Exception of type 'Microsoft.FSharp.Compiler.Tast+InternalUndefined
ItemRef' was thrown.
at Microsoft.FSharp.Compiler.ErrorLogger.ErrorLoggerExtensions.ErrorLogger.Error[b](ErrorLogger x, Exception exn) in
C:\GitHub\fsharp\FSharp.Compiler.Service\src\fsharp\ErrorLogger.fs:line 329
at Microsoft.FSharp.Compiler.Tast.EntityRef.get_Deref() in C:\GitHub\fsharp\FSharp.Compiler.Service\src\fsharp\tast.f
s:line 2549
at Microsoft.FSharp.Compiler.Tastops.stripTyEqnsA(TcGlobals g, Boolean canShortcut, TType ty) in C:\GitHub\fsharp\FSh
arp.Compiler.Service\src\fsharp\tastops.fs:line 627
at Microsoft.FSharp.Compiler.Tastops.stripTyEqnsAndErase(Boolean eraseFuncAndTuple, TcGlobals g, TType ty) in C:\GitH
ub\fsharp\FSharp.Compiler.Service\src\fsharp\tastops.fs:line 645
at Microsoft.FSharp.Compiler.Tastops.stripTyEqnsWrtErasure(Erasure erasureFlag, TcGlobals g, TType ty) in C:\GitHub\f
sharp\FSharp.Compiler.Service\src\fsharp\tastops.fs:line 666
at Microsoft.FSharp.Compiler.Tastops.typeAEquivAux(Erasure erasureFlag, TcGlobals g, TypeEquivEnv aenv, TType ty1, TT
ype ty2) in C:\GitHub\fsharp\FSharp.Compiler.Service\src\fsharp\tastops.fs:line 837
at Microsoft.FSharp.Collections.ListModule.forall2aux[a,b](FSharpFunc3 f, FSharpList1 list1, FSharpList1 list2) at Microsoft.FSharp.Collections.ListModule.ForAll2[T1,T2](FSharpFunc2 predicate, FSharpList1 list1, FSharpList1 li
st2)
at Microsoft.FSharp.Compiler.Tastops.typeAEquivAux(Erasure erasureFlag, TcGlobals g, TypeEquivEnv aenv, TType ty1, TT
ype ty2) in C:\GitHub\fsharp\FSharp.Compiler.Service\src\fsharp\tastops.fs:line 845
at Microsoft.FSharp.Collections.ListModule.forall2aux[a,b](FSharpFunc3 f, FSharpList1 list1, FSharpList1 list2) at Microsoft.FSharp.Collections.ListModule.ForAll2[T1,T2](FSharpFunc2 predicate, FSharpList1 list1, FSharpList1 li
st2)
at Microsoft.FSharp.Compiler.Tastops.typeAEquivAux(Erasure erasureFlag, TcGlobals g, TypeEquivEnv aenv, TType ty1, TT
ype ty2) in C:\GitHub\fsharp\FSharp.Compiler.Service\src\fsharp\tastops.fs:line 845
at Microsoft.FSharp.Collections.ListModule.TryFind[T](FSharpFunc2 predicate, FSharpList1 list)
at Microsoft.FSharp.Compiler.Tast.ValRef.get_Deref() in C:\GitHub\fsharp\FSharp.Compiler.Service\src\fsharp\tast.fs:l
ine 2791
at Microsoft.FSharp.Compiler.Tast.get_MembersOfFSharpTyconSorted@845.Invoke(ValRef v) in C:\GitHub\fsharp\FSharp.Comp
iler.Service\src\fsharp\tast.fs:line 845
at Microsoft.FSharp.Primitives.Basics.List.filterToFreshConsTail[a](FSharpList1 cons, FSharpFunc2 f, FSharpList1 l) at Microsoft.FSharp.Primitives.Basics.List.filter[T](FSharpFunc2 predicate, FSharpList1 l) at Microsoft.FSharp.Collections.ListModule.Filter[T](FSharpFunc2 predicate, FSharpList1 list) at <StartupCode$FSharp-Compiler-Service>[email protected](Unit unitVar0) in C:\GitHub\ fsharp\FSharp.Compiler.Service\src\fsharp\vs\Typed.fs:line 258 at Microsoft.FSharp.Compiler.SourceCodeServices.Impl.protect[a](FSharpFunc2 f) in C:\GitHub\fsharp\FSharp.Compiler.S
ervice\src\fsharp\vs\Typed.fs:line 35
at Microsoft.FSharp.Compiler.SourceCodeServices.FSharpEntity.get_MembersFunctionsAndValues() in C:\GitHub\fsharp\FSha
rp.Compiler.Service\src\fsharp\vs\Typed.fs:line 257
at [email protected](IEnumerable1& next) in c:\Tomas\Public\FSharp.Formatti ng\src\FSharp.MetadataFormat\Main.fs:line 0 at Microsoft.FSharp.Core.CompilerServices.GeneratedSequenceBase1.MoveNextImpl()
at Microsoft.FSharp.Core.CompilerServices.GeneratedSequenceBase1.System-Collections-IEnumerator-MoveNext() at Microsoft.FSharp.Collections.SeqModule.ToList[T](IEnumerable1 source)
at [email protected](String cat, IDictionary2 cmds, Comment comment) in c:\Tomas\Publ ic\FSharp.Formatting\src\FSharp.MetadataFormat\Main.fs:line 619 at FSharp.MetadataFormat.Reader.readCommentsInto[a](ReadingContext ctx, String xmlDoc, FSharpFunc2 f) in c:\Tomas\Pu
blic\FSharp.Formatting\src\FSharp.MetadataFormat\Main.fs:line 506
at FSharp.MetadataFormat.Reader.readType(ReadingContext ctx, FSharpEntity typ) in c:\Tomas\Public\FSharp.Formatting\s
rc\FSharp.MetadataFormat\Main.fs:line 604
at [email protected](ReadingContext ctx, FSharpEntity typ) in c:\Tomas\Pu
blic\FSharp.Formatting\src\FSharp.MetadataFormat\Main.fs:line 595
at Microsoft.FSharp.Collections.IEnumerator.choose@163.System-Collections-IEnumerator-MoveNext()
at Microsoft.FSharp.Collections.SeqModule.ToList[T](IEnumerable1 source) at FSharp.MetadataFormat.Reader.readModulesAndTypes(ReadingContext ctx, IEnumerable1 entities) in c:\Tomas\Public\FS
harp.Formatting\src\FSharp.MetadataFormat\Main.fs:line 596
at FSharp.MetadataFormat.Reader.readNamespace(ReadingContext ctx, String ns, IEnumerable1 entities) in c:\Tomas\Publ ic\FSharp.Formatting\src\FSharp.MetadataFormat\Main.fs:line 671 at [email protected](Tuple2 tupledArg) in c:\Tomas\Public\FSharp.Formatting\src\FSh
arp.MetadataFormat\Main.fs:line 695
at [email protected](b& )
at Microsoft.FSharp.Collections.IEnumerator.MapEnumerator1.System-Collections-IEnumerator-MoveNext() at Microsoft.FSharp.Collections.SeqModule.ToList[T](IEnumerable1 source)
at FSharp.MetadataFormat.Reader.readAssembly(FSharpAssembly assembly, Boolean publicOnly, String xmlFile, FSharpOptio
n1 sourceFolderRepo) in c:\Tomas\Public\FSharp.Formatting\src\FSharp.MetadataFormat\Main.fs:line 690 at <StartupCode$FSharp-MetadataFormat>[email protected](IEnumerable1& next) in c:\Tomas\Public\FS
harp.Formatting\src\FSharp.MetadataFormat\Main.fs:line 812
at Microsoft.FSharp.Core.CompilerServices.GeneratedSequenceBase1.MoveNextImpl() at Microsoft.FSharp.Core.CompilerServices.GeneratedSequenceBase1.System-Collections-IEnumerator-MoveNext()
at Microsoft.FSharp.Collections.SeqModule.ToList[T](IEnumerable1 source) at FSharp.MetadataFormat.MetadataFormat.Generate(FSharpList1 dllFiles, String outDir, IEnumerable1 layoutRoots, FSh arpOption1 parameters, FSharpOption1 namespaceTemplate, FSharpOption1 moduleTemplate, FSharpOption1 typeTemplate, FS harpOption1 xmlFile, FSharpOption1 sourceRepo, FSharpOption1 sourceFolder, FSharpOption1 publicOnly, FSharpOption1
libDirs, FSharpOption`1 otherFlags) in c:\Tomas\Public\FSharp.Formatting\src\FSharp.MetadataFormat\Main.fs:line 800
at <StartupCode$FSI_0002>.$FSI_0002.main@() in C:\Users\gabriele\Desktop\ProjectScaffold\docs\tools\generate.fsx:line
93