Open 2moveit opened 6 years ago
I am not an author, but I know that TP loads the resource from executing assembly - https://github.com/fsprojects/FSharp.Configuration/blob/master/src/FSharp.Configuration/ResXProvider.fs#L39 so TP expects that resource is compiled into assembly, that probably means that it does not work from fsi.
Do you know how to load resources rather than using ResourceManager
? https://github.com/fsprojects/FSharp.Configuration/blob/master/src/FSharp.Configuration/ResXProvider.fs#L25
It not ... we probably should update docs
Maybe it's possible with CreateFileBasedResourceManager, But then the .resx file needs to be "compiled" with resgen to a ..resource file. Is that possible to do in the type provider?
I just moved the type provider in the .fs file. You can reference the dll that uses the type provider in the .fsi script and it will work.
I had one gotcha. I got a MissingManifestResourceException. I created the .resx files with VS 15.6.7. There is a new option (e.g. not available in 15.2) in the project properties -> Application -> Resources -> Use standard resource names. This has to be deactivated.
I guess many people usually start testing type providers in the fsi. So I would recommend that the docs should mention that while no other solution is implemented.
I just wonder how this output can work? https://github.com/fsprojects/FSharp.Configuration/blob/9b84f3e9dc873a7f3c9c38cdb97133b0bb556d01/docs/content/ResXProvider.fsx#L37
I tried the ResXProvider like described on the doc page just with my resx file. I do get intellisense so it seems to work. When I start the four lines of the script in the fsi of VS 2017 I do get the following error:
I sounds that it is not possible to start it from the fsi, is it? If not a hint on the website would be great but more likely I missed something.