Open isaacabraham opened 8 years ago
@isaacabraham I think the provider was changed recently, can you check this change: https://github.com/fsprojects/FSharp.Configuration/commit/d88444a44d11aae8f12b65fc2758d34aa0d46a47 or this part of the documentation: http://fsprojects.github.io/FSharp.Configuration/AppSettingsProvider.html#Using-AppSettingsProvider-in-fsx-script
Yes - that's referring rather to runtime redirection though rather than compile-time.
@isaacabraham can you try
let [<Literal>] appSettingsPath = __SOURCE_DIRECTORY__ + "/app.config"
type Config = FSharp.Configuration.AppSettings<appSettingsPath>
@isaacabraham in case you didn't figure this out, you have to set both the full path and then SelectExecutableFile
, e.g.
// Script name is Script1.fsx
let [<Literal>] appSettingsPath = __SOURCE_DIRECTORY__ + "/Script1.fsx.config"
type Config = FSharp.Configuration.AppSettings<appSettingsPath>
let [<Literal>] executableFile = __SOURCE_DIRECTORY__ + "/Script1.fsx"
Config.SelectExecutableFile executableFile
I have an .fs file which references the AppSettings provider. If I
#load
this file from a script, the code does not compile (I imagine because the TP is trying to locate the properties from FSI's app.config). Is there any way around this? The redirection support is only for runtime, not design time.