Update a typeprovider

Hi all

How do I update a typeprovider.

I am using the AppSettings - Typeprovider.

open FSharp.Configuration
type Settings = AppSettings<“app.config”>

I added these lines with the app.config present. All was fine. Now I made some changes in the app.config and the type provider wont update. It still has the old values.

Changing the name of the file does update the provider but i cannot always rename the file if i make changes to the content of the file.

Any idea?

The type provider does its thing at compile time. Do you recompile after changing app.config?

Yes, i did a clean and a build. What i can see is still old values from days ago in the type provider.
I added an entry in the app.config and it did appear in Settings but i also see entries that i dont have in the app.config.

Red, i cant explain, green is good.

image

In my .fsproj file, I have this entry for the json file:

  <ItemGroup>
    <None Include="conf/database.json" CopyToOutputDirectory="Always" />
  </ItemGroup>    

I honnestly don’t remember, but maybe the Always will ensure a copy the updated file will be taken?

Thanks for the reply. That was the first ting i set. No change thus far.

Try changing the name of the file to something wrong and back:

AppSettings<“app.configxx”>

AppSettings<“app.config”>

Yes that is working. I changed from upper to lower case A. The red circled items still stay though. Maybe they are default entries. Not sure.

But would that be the way to go? Changing strings to make things work? I am not sure about the inner workings of that type provider. Maybe there is a way to kind of clean it.