ionide / Fornax

Scriptable static site generator using type safe F# DSL to define page templates.
MIT License
241 stars 44 forks source link

Fornax.Core dll not reference-able using '#r "nuget:Fornax" #70

Closed jbeeko closed 1 year ago

jbeeko commented 4 years ago

Describe the bug #r "nuget:Fornax" will download the package to the .nuget cache but the dll can't be found. This means in the F# 5.0 world it will not be possible to write loaders, etc with just nuget refs.

To Reproduce Open the below as a .fsx file in Ionide on a system with .NET 5.0 installed. Note SiteContents is not not visible to compiler. Uncomment the direct reference and it becomes visible. I believe this is because the Fornax.Core.dll is in a non-standard location.

#r "nuget: Fornax"
//#r "/Users/joergbeekmann/.nuget/packages/fornax/0.13.1/tools/netcoreapp3.1/any/Fornax.Core.dll"

let x: SiteContents option = None

Expected behaviour SiteContents should be resolved like it is if the direct reference is in place.

Screenshots If applicable, add screenshots to help explain your problem.

Environment (please complete the following information):

Krzysztof-Cieslak commented 4 years ago

I think the issue is we don't use --langversion:preview in FSI session hosted in Fornax - https://github.com/ionide/Fornax/blob/master/src/Fornax/Generator.fs#L31

jbeeko commented 4 years ago

@Krzysztof-Cieslak I don't think that is the issue because on my system with with F# 5.0 the compiler service can't resolve those references. But I'll find out if they can be referenced in a standard project in which case the bug is on the FSharp compiler side.

Krzysztof-Cieslak commented 4 years ago

Oh, it may be caused by the fact Fornax is packed as a tool and referencing tool is probably not supported scenario. In such a case, we will need to release Fornax.Core as normal NuGet package.

CC: @cartermp could you confirm this suspicion?

cartermp commented 4 years ago

Yeah, you can't reference a global tool like a normal nuget package:

image

So you'd need to release some kind of core library for folks to use if they want to do it that way.

MangelMaxime commented 1 year ago

Is it be possible to release Fornax.Core as a NuGet package?

In my project I am using paket to manage the dependencies thanks to its generate_load_scripts features. And Fornax.Core is the only dll I cannot manage this way.

Note: I am using paket instead of #r "nuget: ..." because #r is really slow to resolve. For me it adds 4 sec per fsx file where it is present. Because paket install the dlls locally it doesn't "really" had a overhead each time the file is being process.

TheAngryByrd commented 1 year ago

@MangelMaxime https://www.nuget.org/packages/Fornax.Core/ is available now.