Skip to content

Could not load System.Text.Json 7.0.0.0 #213

@rametta

Description

@rametta

Description

Hello, starting a new project and trying to use SwaggerProvider and following the getting started docs I get an error of:

The type provider 'SwaggerProvider.OpenApiClientTypeProvider' reported an error: Could not load file or assembly 'System.Text.Json, Version=7.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. Could not find or load a specific file. (0x80131621)

when I try to init the first provider.

Repro steps

Start a new project, install SwaggerProvider 2.0.0-beta7. Follow the getting started docs, see error

Screen Shot 2022-12-14 at 10 47 46 AM

This happens with both SwaggerClientProvider and OpenApiClientProvider

here is my fsproj file

<Project Sdk="Microsoft.NET.Sdk">

    <PropertyGroup>
        <TargetFramework>net6.0</TargetFramework>

        <IsPackable>false</IsPackable>
        <GenerateProgramFile>false</GenerateProgramFile>
    </PropertyGroup>

    <ItemGroup>
        <Compile Include="Tests.fs" />
        <Compile Include="Program.fs" />
    </ItemGroup>

    <ItemGroup>
        <PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.11.0" />
        <PackageReference Include="SwaggerProvider" Version="2.0.0-beta7" />
        <PackageReference Include="xunit" Version="2.4.1" />
        <PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">
            <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
            <PrivateAssets>all</PrivateAssets>
        </PackageReference>
        <PackageReference Include="coverlet.collector" Version="3.1.0">
            <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
            <PrivateAssets>all</PrivateAssets>
        </PackageReference>
    </ItemGroup>

</Project>

Expected behavior

No error for missing dependencies

Actual behavior

Error showing that missing dependency and when explicitly installing that dependency the error still does not go away

Known workarounds

None that I know of, I can not get it to work.

Affected Type Providers

  • SwaggerClientProvider
  • OpenApiClientProvider

Related information

  • Operating system: MacOS Monterey
  • Branch
  • .NET Runtime, CoreCLR or Mono Version: Net6
  • Performance information, links to performance testing scripts

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions