Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

reloading type providers

I am using the MiniCSVTypeProvider provided in the fsharp powerpack samples.

Unfortunately, it thinks the values provided are float, while mine are of various (varying) formats. I therefore rewrote the MiniCsvType provider to always provide strings instead, leaving the parsing work to the caller.

But for some odd reason, after dereferencing the old DLL and including a reference to the new DLL, it kept providing float, using the old type provider. I had to change the names of assembly and classes to have VS refresh it.

Is there any other ways to revoke/reset a former type provider so that VS takes the change into account?

like image 809
nicolas Avatar asked Feb 27 '12 18:02

nicolas


2 Answers

In general, when developing a type provider, you'll need to shut down the instance of VS that's consuming a type provider in order to update the provider. A common workflow is to have two VS instances: one that's working on the code of the type provider itself, which stays open, and another that's referencing/consuming/testing the provider, which you close each time you're going to make a change. The consumer VS often locks the DLL on disk, and also cannot unload/reload the assembly into its process, which is why you need to end the VS process to iterate on your type provider implementation.

like image 143
Brian Avatar answered Oct 08 '22 20:10

Brian


A bit late, but encountering the same problem, I solved it by deactivating and reactivating the type provider from Tools -> Options -> F# Tools -> Type providers. (I am using VS2013)

like image 31
Stefan Turcanu Avatar answered Oct 08 '22 19:10

Stefan Turcanu