JsonProvider doesn't refresh the source when using a web document
Issue
When using a JsonProvider source from the web such as
type Config = JsonProvider<"https://somesite.com/some-file.json", RootName="Config">
The document is read and the properties are available. If that file is altered (added or removed properties) the provider does not refresh this automatically.
I have confirmed this in both FSI and Compiled.
Steps I took to try and get it to refresh and ultimately failed were
- Break the URL and fix it
- Rebuild
- Manually delete the
binandobjdirectories - Unload/reload the project
- Close/reopen VS
- Waiting 30 minutes (in-fact I waited several hours as an understanding that the cache is set to 30 minutes)
Workaround
After reaching out to the F# community on their Slack channel I was directed to this line of code that indicated a cache directory in AppData. Only after deleting the DesignTimeURIs directory did the provider refresh and pull in my new properties for me.
Repro steps
- Create a json file and host it in a publicly accessible web address
- Declare the type in F# using the
JsonProviderpointing at the file from the address in step 1 - Inspect the type and note the properties available
- Alter the original json document and update it to the address
- Try the steps I noted in the second section above
- Try the Workaround noted above
Setup
Windows 10 64bit 19041.867 Visual Studio Professional 2019 v16.9.0 FSharp.Core 5.0
Let me know if you need any additional information.
Looks like a fix was PR'd in #1365. Leaving open for visibility until approved.