Visitar URL original
OpenApiClientProvider can't be found · Issue #490 · fsprojects/SwaggerProvider · GitHub
Skip to content

OpenApiClientProvider can't be found #490

Open

Description

@exascape

Just installed the SwaggerProvider and I keep getting an error
about the OpenApiClientProvider type not being found.

I have tried 4.1.0 and 4.0.0 to no avail; it seems like the type
has been elided from the package for reasons unknown. The package
does seem to be installed; importing it does not raise any errors,
and dotnet package list includes SwaggerProvider.

I installed and used the package with .NET version 10.0.400 in F#.

Example

open SwaggerProvider

let [<Literal>] Schema = "https://random-url.com/openapi.json"
type GotifyApi = OpenApiClientProvider<Schema>

Bit of a newbie to .NET so I assumed it was an issue on my side
until I discovered #248 -- it seems directly related to that.

Happy to help in any other way I can.

Activity

  1. exascape commented on Sep 9, 2026

    @exascape
    Author

    Oh, one more thing: the F# compiler got very, very
    angry when I installed this package. I'll include
    the errors below:

    • '/Users/exascape/.nuget/packages/swaggerprovider/4.2.0/lib/net10.0/SwaggerProvider.Runtime.dll' reported an error: The type provider designer assembly 'SwaggerProvider.DesignTime.dll' could not be loaded from folder '/Users/exascape/.nuget/packages/swaggerprovider/4.2.0/typeproviders/fsharp41/net10.0'.

    • The exception reported was: System.IO.FileNotFoundException - Could not load file or assembly 'FSharp.Core, Version=10.1.0.0, Culture=neutral, PublicKeyToken=xxx'. The system cannot find the file specified. F# Compiler[3049]

    • Referenced assembly '/Users/exascape/.nuget/packages/swaggerprovider/4.2.0/lib/net10.0/SwaggerProvider.Runtime.dll' has assembly level attribute 'Microsoft.FSharp.Core.CompilerServices.TypeProviderAssemblyAttribute' but no public type provider classes were foundF# Compiler[3005]

    Could it be that I'm using too new of a .NET version?
    I assumed it would be OK as I thought 10 has been out
    for quite a while; I'm unsure if the package doesn't
    support it, however?

    It was installed via dotnet package add too. I found
    it strange that FSharp.Core was missing; I did install
    it separately afterwards and it doesn't seem to have
    removed the error.

  2. github-actions commented on Sep 9, 2026

    @github-actions
    Contributor

    🤖 This is an automated response from Repo Assist.

    Thanks for the detailed report, including the compiler error — that's very helpful.

    The root cause is visible in your compiler error: Could not load file or assembly 'FSharp.Core, Version=10.1.0.0' ... The system cannot find the file specified.

    The net10.0 design-time assembly (typeproviders/fsharp41/net10.0/SwaggerProvider.DesignTime.dll) is built with ExcludeAssets=runtime for FSharp.Core, meaning FSharp.Core.dll is intentionally not shipped alongside it — the type provider host (the F# compiler / IDE tooling) is expected to supply a compatible FSharp.Core at design time. When the host process can't resolve FSharp.Core, Version=10.1.0.0 (e.g. dotnet build/dotnet package add did not yet restore/copy a matching FSharp.Core.dll next to the compiler in your global tool/SDK context), the type provider designer assembly fails to load, and OpenApiClientProvider disappears entirely — exactly what you're seeing.

    Suggested workaround to confirm this is the cause:

    1. Run dotnet restore (not just dotnet package add) on your project so FSharp.Core 10.x is fully restored into your project's obj/package cache.
    2. dotnet clean the project, delete bin/obj, then rebuild.
    3. Make sure your SDK/CLI version and the FSharp.Core version referenced by your project are aligned (SDK 10.0.400 ships FSharp.Core 10.1.0.0, which matches the error — so this is likely a restore/resolution timing issue rather than a version mismatch).
    4. If using an IDE (VS Code + Ionide, Rider, etc.), fully reload/restart the F# language service after restoring, since it caches assembly resolution.

    If the workaround above doesn't resolve it, could you share the output of dotnet restore -v:detailed (or equivalent) for your project? That would help pin down whether FSharp.Core.dll is actually missing from your NuGet cache/output, or if this is a design-time assembly resolution probing-path issue specific to dotnet package add scaffolding. This looks related to but distinct from the now-closed #248 (which was about older .NET/design-time targeting), since 4.2.0 already ships net10.0 design-time binaries.

    Generated by 🌈 Repo Assist, see workflow run. Learn more.
    Comment /repo-assist to run again

    Add this agentic workflow to your repo

    To install this agentic workflow, run

    gh aw add githubnext/agentics/workflows/repo-assist.md@ae8d551f07c7ed7619f8c58c7bb4c3ac89395d38
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions