question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Exception when upgrading Npgsql to Version 5.0.0-preview1.1

See original GitHub issue

Hi,

It seems EF Core tools doesn’t play well with the new version. In my project, as soon as I upgrade Npgsql to version 5.0.0-preview1.1 (from 5.0.0-alpha1), I get the following exception:

  Message: 
        [Test Collection Cleanup Failure (ApiIntegrationTestsCollection)]: System.MissingMethodException : Method not found: 'System.String System.Data.Common.DbException.get_SqlState()'.
      Stack Trace: 
        <<DoReadMessage>g__ReadMessageLong|0>d.MoveNext()
        AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine)
        <>c__DisplayClass170_0.<DoReadMessage>g__ReadMessageLong|0(DataRowLoadingMode dataRowLoadingMode2, Boolean readingNotifications2, Boolean isReadingPrependedMessage, CancellationToken cancellationToken2)
        NpgsqlConnector.DoReadMessage(Boolean async, DataRowLoadingMode dataRowLoadingMode, Boolean readingNotifications, CancellationToken cancellationToken)
        NpgsqlConnector.ReadMessage(Boolean async, CancellationToken cancellationToken)
        NpgsqlConnector.Authenticate(String username, NpgsqlTimeout timeout, Boolean async, CancellationToken cancellationToken)
        NpgsqlConnector.Open(NpgsqlTimeout timeout, Boolean async, CancellationToken cancellationToken)
        <<Open>g__OpenAsync|0>d.MoveNext()
        --- End of stack trace from previous location ---
        NpgsqlConnection.Open()
        NpgsqlDatabaseCreator.Exists()
        RelationalDatabaseCreator.EnsureDeleted()
        DatabaseFacade.EnsureDeleted()
        ApiIntegrationTestsFixture.Dispose(Boolean disposing) line 63
        WebApplicationFactory`1.Dispose()

Here’s are the packages installed in my project, either one of the following changes triggers the error:

<ItemGroup>
  <PackageReference Include="FluentValidation" Version="9.2.2" />
  <PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="5.0.0-rc.2.20475.17" />
  <PackageReference Include="Microsoft.AspNetCore.Http.Extensions" Version="2.2.0" />
  <PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="5.0.0-rc.2.20475.17" />    
  <PackageReference Include="Microsoft.AspNetCore.OData" Version="8.0.0-preview" />
  <PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="5.0.0-rc.2.20475.6">
    <PrivateAssets>all</PrivateAssets>
    <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
  </PackageReference>
-  <PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL.NetTopologySuite" Version="5.0.0-rc1" />
+  <PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL.NetTopologySuite" Version="5.0.0-rc2" />
-  <PackageReference Include="Npgsql.Json.NET" Version="5.0.0-alpha1" />
+  <PackageReference Include="Npgsql.Json.NET" Version="5.0.0-preview1.1" />
  <PackageReference Include="Weitzhandler.FluentValidaiton.EntityFrameworkCore" Version="0.2.0" />
</ItemGroup>

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
weitzhandlercommented, Oct 16, 2020

After setting the global.json to the rc2 sdk, it worked fine. Sorry for the hassle and thanks for your diligence @roji.

0reactions
rojicommented, Oct 16, 2020

Thanks for looking into it and confirming @weitzhandler.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Npgsql 5.0 Release Notes
Npgsql forcibly closes the physical connection and raises an exception, making sure the application isn't blocked. Previous support was inconsistent across ...
Read more >
Npgsql can't find NpgsqlException when doing Migrations
Its trying to tell me about an error but I presume it can't find the exception type its trying to wrap it in...
Read more >
Npgsql 2.2.0
Version Downloads Last updated 8.0.0‑preview.4 37,402 3 months ago 8.0.0‑preview.3 19,170 4 months ago 8.0.0‑preview.2 24,586 5 months ago
Read more >
Versioning Policy
Version Current minor Supported First Release Final Release 15 15.4 Yes October 13, 2022 November 11, 2027 14 14.9 Yes September 30, 2021 November 12,...
Read more >
Major Version Upgrade for PostgreSQL Flexible Server
Most extensions are automatically upgraded to higher versions during an in-place major version upgrade, with some exceptions. Refer limitations ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found