eShop icon indicating copy to clipboard operation
eShop copied to clipboard

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

Open v-sherryfan opened this issue 2 years ago • 3 comments

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

EXPECTED F5 to work successfully

v-sherryfan avatar Dec 11 '23 09:12 v-sherryfan

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" />

eerhardt avatar Dec 11 '23 20:12 eerhardt

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

v-sherryfan avatar Dec 12 '23 03:12 v-sherryfan

Is this still relevant?

davidfowl avatar Jan 09 '24 06:01 davidfowl