fsprojects / SwaggerProvider

F# generative Type Provider for Swagger

Home Page:https://fsprojects.github.io/SwaggerProvider/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Referencing the design time?

Thorium opened this issue · comments

There are some .fsx test files referencing SwaggerProvider.dll (like
here and here)
I don't have that. So I'm expecting that they are expired and they should be SwaggerProvider.DesignTime.dll.

As a user of this library, I do need my code reference both the runtime and the design-time dll, right?

Yes, they are expired and should be replaced by SwaggerProvider.DesignTime.dll (as well as list of dependencies probably)

As a user of this library, I do need my code reference both the runtime and the design-time dll, right?

No, if you compiles your fsproj file or works from IDE (you reference only runtime and compiler will find design-time assembly)
But I not quite sure how FSI will search for design-time assembly.

if you reference runtime assembly compiled for runtime of your FSI and design time assembly is in the same folder than it should be enough to reference one (runtime only)

But it you reference runtime dll from the restore NuGet package and expect that FSI know about package layout and find current version of design-time assembly and it's dependencies .... so I am not sure that it is fully supported.

Back in the day I referenced both assemblies and did #I for folder from where FSI should load System.Net.Http and Newtonsoft.Json

Ok, found it:
The only reason to reference *.DesignTime.dll is if the type-provider assemblyReplacementMap is set incorrectly. :-)
So the *.fsx shouldn't refer any *.DesignTime.dll. If external references the '#I' should be enough.
FSI will find it because of TypeProviderAssemblyAttribute in *.Runtime.dll, and then the desing-time assembly should say to replace it back with assemblyReplacementMap.