5
votes

Is it possible for a generative type provider, when using the ProvidedTypes API, to add resources in addition to types to the assembly?

I'd like to build in specific resources generated along with the concrete types built by my provider. If this is possible, how would I accomplish it?

1
+1 I've been wondering about this myself recently. - Jack P.
@JackP. It looks like its not directly possible - though if you write the plumbing for the type provider yourself, resources from the assembly you generate seem to be mixed in. Trying some more detailed experiments now to verify, though I think it works in that case. Don't see how to do it with the ProvidedTypes API/base classes in the samples, though. - Reed Copsey
Thanks, that's good to know. - Jack P.

1 Answers

1
votes

Does it need to be in the same assembly? You can only generate types, you have no control of the assembly that F# generates, but if it doesn't need to be in the same assembly, maybe you can generate an assembly with resources manually and then use a generated type provider to reference that. But it will probably be a long shot