# Update a typeprovider

**URL:** <https://forums.fsharp.org/t/update-a-typeprovider/1496>\
**Category:** General\
**Tags:** beginners\
**Created:** [October 22, 2020, 7:23am UTC](https://forums.fsharp.org/t/update-a-typeprovider/1496 "2020-10-22T07:23:40Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![RicoSaupe](https://yyz2.discourse-cdn.com/flex030/user_avatar/forums.fsharp.org/ricosaupe/32/1092_2.png) [@RicoSaupe](https://forums.fsharp.org/u/RicoSaupe)\
**Post date:** [October 22, 2020, 7:23am UTC](https://forums.fsharp.org/t/update-a-typeprovider/1496/1 "2020-10-22T07:23:40Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![rbauduin](https://yyz2.discourse-cdn.com/flex030/user_avatar/forums.fsharp.org/rbauduin/32/314_2.png) [@rbauduin](https://forums.fsharp.org/u/rbauduin)\
**Post date:** [October 23, 2020, 4:18pm UTC](https://forums.fsharp.org/t/update-a-typeprovider/1496/2 "2020-10-23T16:18:38Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![RicoSaupe](https://yyz2.discourse-cdn.com/flex030/user_avatar/forums.fsharp.org/ricosaupe/32/1092_2.png) [@RicoSaupe](https://forums.fsharp.org/u/RicoSaupe)\
**Post date:** [October 23, 2020, 6:17pm UTC](https://forums.fsharp.org/t/update-a-typeprovider/1496/3 "2020-10-23T18:17:13Z")

</div>

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](https://canada1.discourse-cdn.com/flex030/uploads/fsharp/original/1X/415c0ac696a943ee7ce719b68a4c7f35bbac7f28.png)

---

<div class="post-metadata">

**Author:** ![rbauduin](https://yyz2.discourse-cdn.com/flex030/user_avatar/forums.fsharp.org/rbauduin/32/314_2.png) [@rbauduin](https://forums.fsharp.org/u/rbauduin)\
**Post date:** [October 24, 2020, 9:17am UTC](https://forums.fsharp.org/t/update-a-typeprovider/1496/4 "2020-10-24T09:17:46Z")

</div>

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

```auto
  <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?

---

<div class="post-metadata">

**Author:** ![RicoSaupe](https://yyz2.discourse-cdn.com/flex030/user_avatar/forums.fsharp.org/ricosaupe/32/1092_2.png) [@RicoSaupe](https://forums.fsharp.org/u/RicoSaupe)\
**Post date:** [October 25, 2020, 7:05am UTC](https://forums.fsharp.org/t/update-a-typeprovider/1496/5 "2020-10-25T07:05:00Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![amieres](https://yyz2.discourse-cdn.com/flex030/user_avatar/forums.fsharp.org/amieres/32/687_2.png) [@amieres](https://forums.fsharp.org/u/amieres)\
**Post date:** [October 25, 2020, 9:12pm UTC](https://forums.fsharp.org/t/update-a-typeprovider/1496/6 "2020-10-25T21:12:48Z")

</div>

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

`AppSettings<“app.configxx”>`

`AppSettings<“app.config”>`

---

<div class="post-metadata">

**Author:** ![RicoSaupe](https://yyz2.discourse-cdn.com/flex030/user_avatar/forums.fsharp.org/ricosaupe/32/1092_2.png) [@RicoSaupe](https://forums.fsharp.org/u/RicoSaupe)\
**Post date:** [October 25, 2020, 9:39pm UTC](https://forums.fsharp.org/t/update-a-typeprovider/1496/7 "2020-10-25T21:39:09Z")

</div>

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.
