Menu

#126 [WebToolsE2E][Aspire] Running the eshop.web solution throws an exception: Method not found: 'Void Npgsql.TypeMapping.INpgsqlTypeMapper.AddTypeInfoResolver(Npgsql.Internal.IPgTypeInfoResolver)'.

open
nobody
None
2023-12-12
2023-12-11
Anonymous
No

Originally created by: v-sherryfan

REGRESSION INFO: Worked fine with Aspire 8.0.0-preview.1.23557.2

INSTALL STEPS

  1. Clean machine: Win11 x64 23h2 ENU
  2. Install VS 17.9 P2
  3. Install Aspire Preview 2 latest build 8.0.0-preview.2.23610.1
  4. Apply NuGet Feeds
  5. Install Docker Desktop

REPRO STEPS

  1. Clone the eShop repo
  2. Update NuGet.config to use the dotnet-tools feed
  3. Update Directory.Packages.props to use aspire version 8.0.0-preview.2.23610.1
  4. Update package Npgsql.EntityFrameworkCore.PostgreSQL '8.0.0' and Yarp.ReverseProxy '2.1.0'
  5. Open solution eShop.Web.slnf
  6. Build and F5

ACTUAL
System.MissingMethodException
HResult=0x80131513
Message=Method not found: 'Void Npgsql.TypeMapping.INpgsqlTypeMapper.AddTypeInfoResolver(Npgsql.Internal.IPgTypeInfoResolver)'.
Source=Pgvector
StackTrace:
at Npgsql.VectorExtensions.UseVector(INpgsqlTypeMapper mapper)
at Microsoft.EntityFrameworkCore.VectorDbContextOptionsBuilderExtensions.UseVector(NpgsqlDbContextOptionsBuilder optionsBuilder)
at Extensions.<>c.<addapplicationservices>b__0_1(NpgsqlDbContextOptionsBuilder builder) in C:\Users\xxx\source\repos\eShop\src\Catalog.API\Extensions\Extensions.cs:line 11
at Microsoft.EntityFrameworkCore.NpgsqlDbContextOptionsBuilderExtensions.UseNpgsql(DbContextOptionsBuilder optionsBuilder, Action`1 npgsqlOptionsAction)
image</addapplicationservices>

EXPECTED
F5 to work successfully

Discussion

  • Anonymous

    Anonymous - 2023-12-11

    Originally posted by: eerhardt

    This looks like Pgvector needs to be updated to the Npgsql v8.0 compatible version.

    @v-sherryfan - can you also update these two lines?

    https://github.com/dotnet/eShop/blob/1417a0c6f78b0f6e9da0352cbfc9dc5a46dda088/Directory.Packages.props#L38-L39

    to be

        <PackageVersion Include="Pgvector" Version="0.2.0" />
        <PackageVersion Include="Pgvector.EntityFrameworkCore" Version="0.2.0" />
    
     
  • Anonymous

    Anonymous - 2023-12-12

    Originally posted by: v-sherryfan

    @eerhardt After updating the above package according to your instructions, the error will disappear.

     

Log in to post a comment.