Skip to content

Relative paths and external loading on library usage #1520

@Thorium

Description

@Thorium

I would like to keep 3rd party data-structures of JSON / XML files (samples) in separate files, so that e.g. the intellisense of those files is easily checked.

So I like using F# data with, great:

// Library 1 (a dll):
FSharp.Data.JsonProvider<"json-samples/whateverService.json", SampleIsList = true>
//...logic to use the types.

// Root project (e.g. myprogram.exe): Project reference (or NuGet) to Library 1.

However, when multiple F# projects exist, e.g., via separate NuGet libraries or separate F# dlls, it's really unclear (on compile-time) what the relative path is pointing to.

So it seems this "json-samples"-folder should be included in all the root level programs, while my expectation would be that it only points to the library of actual source code above (Library1). FSharp.Data is a generative provider. Wouldn't it be enough to generate the types on the compilation of Library1, then embed them there, and never spend resources to regenerate them again (on design-time and compilation of "root programs")?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions