cannorin / Markdig.Extensions.Literate

Helps implementing literate programming for Markdig
Apache License 2.0
3 stars 0 forks source link

Not working on .NET Core #1

Open cannorin opened 5 years ago

cannorin commented 5 years ago
 System.Exception : Could not find a FSharp.Core.dll (with bundled .optdata and .sigdata) in
[ "/home/alice/codes/Markdig.Extensions.Literate/tests/bin/Debug/netcoreapp2.2/FSharp.Core.dll"
  "/home/alice/codes/Markdig.Extensions.Literate/tests/bin/Debug/netcoreapp2.2/FSharp.Core.dll" ]
---- System.Exception : Could not find a FSharp.Core.dll (with bundled .optdata and .sigdata) in
[ "/home/alice/codes/Markdig.Extensions.Literate/tests/bin/Debug/netcoreapp2.2/FSharp.Core.dll"
  "/home/alice/codes/Markdig.Extensions.Literate/tests/bin/Debug/netcoreapp2.2/FSharp.Core.dll" ]
Stack Trace:
   at FSharp.CodeFormat.CodeFormatAgent.ParseSource(String file, String source, FSharpOption`1 options, FSharpOption`1 defines) in C:\projects\fsharp-formatting-32np3\src\FSharp.CodeFormat\CodeFormatAgent.fs:line 466
   at FSharp.Literate.Markdig.Transformations.formatCodeSnippets(CompilerContext ctx, String path, FSharpList`1 doc) in /home/alice/codes/Markdig.Extensions.Literate/src/Markdig.Extensions.Literate.FSharp/Transformation.fs:line 103
   at FSharp.Literate.Markdig.Transformations.createEvaluationMapping(CompilerContext ctx, String path, FSharpList`1 codeBlocks) in /home/alice/codes/Markdig.Extensions.Literate/src/Markdig.Extensions.Literate.FSharp/Transformation.fs:line 241
   at <StartupCode$Markdig-Extensions-Literate-FSharp>.$Extension.Initialize@45.Invoke(FSharpList`1 codeBlocks) in /home/alice/codes/Markdig.Extensions.Literate/src/Markdig.Extensions.Literate.FSharp/Extension.fs:line 59
   at Markdig.Extensions.Literate.LiterateCodeBlockRenderer`1.Write(HtmlRenderer renderer, CodeBlock block) in /home/alice/codes/Markdig.Extensions.Literate/src/Markdig.Extensions.Literate/LiterateCodeBlock.fs:line 161
   at Markdig.Renderers.RendererBase.Write[T](T obj) in C:\projects\markdig\src\Markdig\Renderers\RendererBase.cs:line 138
   at Markdig.Renderers.RendererBase.WriteChildren(ContainerBlock containerBlock) in C:\projects\markdig\src\Markdig\Renderers\RendererBase.cs:line 69
   at Markdig.Renderers.RendererBase.Write[T](T obj) in C:\projects\markdig\src\Markdig\Renderers\RendererBase.cs:line 145
   at Markdig.Renderers.TextRendererBase.Render(MarkdownObject markdownObject) in C:\projects\markdig\src\Markdig\Renderers\TextRendererBase.cs:line 60
   at Markdig.Markdown.ToHtml(String markdown, TextWriter writer, MarkdownPipeline pipeline) in C:\projects\markdig\src\Markdig\Markdown.cs:line 100
   at Markdig.Markdown.ToHtml(String markdown, MarkdownPipeline pipeline) in C:\projects\markdig\src\Markdig\Markdown.cs:line 74
   at Tests.Can parse and format markdown with Github-flavoured F# snippet starting and ending with empty lines() in /home/alice/codes/Markdig.Extensions.Literate/tests/Tests.fs:line 36
----- Inner Stack Trace -----
   at Microsoft.FSharp.Core.PrintfModule.PrintFormatToStringThenFail@1645.Invoke(String message)
   at <StartupCode$FSharp-CodeFormat>.$CodeFormatAgent.clo@279-2.Invoke(StringReader _arg3) in C:\projects\fsharp-formatting-32np3\src\FSharp.CodeFormat\CodeFormatAgent.fs:line 287
   at Microsoft.FSharp.Control.AsyncPrimitives.CallThenInvoke[T,TResult](AsyncActivation`1 ctxt, TResult result1, FSharpFunc`2 part2)
   at <StartupCode$FSharp-Core>.$Mailbox.processFirstArrival@344-8.Invoke(AsyncActivation`1 ctxt)
   at Microsoft.FSharp.Control.Trampoline.Execute(FSharpFunc`2 firstAction)
cannorin commented 5 years ago

https://github.com/matthid/Yaaf.FSharp.Scripting/blob/develop/src/source/Yaaf.FSharp.Scripting/YaafFSharpScripting.fs#L160

cannorin commented 5 years ago

https://github.com/cannorin/Markdig.Extensions.Literate/commit/2d9c4ff9b0f8852f6aa7fa713e6e0cb68197589f solved one problem but now there is another one:

The type referenced through 'System.Object' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Runtime'."

It seems I have to fork FSharp.Formatting and make it add reference to it (and perhaps other default assemblies)

NatElkins commented 5 years ago

@cannorin Have you considered adding explicit references to a version of FSharp.Core? I do this in all of my projects.

cannorin commented 5 years ago

@NatElkins yes but it didn't help. btw the problem that Yaaf fails to find FSharp.Core is now solved, and a new problem is that FSI does not load System.Runtime automatically.

cannorin commented 5 years ago

The main problem is that .NET Core support of FSI is not yet complete, so I will

1) try to list up the default reference FSI on Mono would use and pass them to the netcore FSI.

2) if that fails, try to get rid of FSI. I can obtain the entire source code, so it might be possible to compile them together and then extract the information.

3) if that also fails, stick to Mono until netcore FSI is ready.

ghost commented 5 years ago

netcore + FSI blocked by https://github.com/Microsoft/visualfsharp/issues/2407