2012-11-19

1st build of an F# Type Provider for .proto files

Froto.Gen 0.0.0.1 is now up on NuGet. It was my first public build of an generative F# type provider for .proto files. The type provider uses Froto.Roslyn to generate an assembly internally and exposes the types.

Here is what is currently working. I generate types for serializing and deserializing messages defined in riak.proto in an F# project. Those two lines are all that is needed. I am then able to reference that F# project from another .NET project. Here I'm showing that the types were generated and are usable from a C# project. The only runtime dependency is protobuf-net. There is no dependency on Froto.Gen, Froto.Roslyn, Roslyn, etc.


Here is where doesn't work and where I need help. I must be doing something wrong in this code. When I try to use the types from the same F# project that the type is defined in, it says that the "type could not be found in that assembly". It is in there. I don't understand. Help!

I discovered the hard way that all dependencies for a type provider must be in the same directly. I was expecting a type provider to be able to use dependencies for the project. I don't think the Roslyn CTP license allows me to redistribute the assemblies, so you need to run packages/Froto.Gen.0.0.0.1\lib\net45\Roslyn.bat to download and copy them from NuGet or you need to install the Roslyn CTP. That is my current solution to the stackoverflow question I asked titled "How do I distribute an F# Type Provider via NuGet?".

I also opened these other questions: