Skip to content

VSIX is broken in 4.1.0 and 4.1.1 #2670

Closed

Description

@hastarin

Steps to reproduce

Using Visual Studio 2019 v16.3.2 try using the Server Explorer to add a connection to a Postgres database.
Click Test connection.

The issue

An error is shown with:
The type initializer for 'Npgsql.TypeMapping.GlobalTypeMapper' threw an exception.

I have traced this based on the master branch to the GetTypes() call within the foreach at the start of GlobalTypeMapper.SetupGlobalTypeMapper

Specifically the following exception is thrown:

Could not load file or assembly 'Microsoft.Bcl.AsyncInterfaces, Version=1.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The system cannot find the file specified.

Npgsql version: 4.1.1
PostgreSQL version: PostgreSQL 11.5 (Debian 11.5-1.pgdg90+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 6.3.0-18+deb9u1) 6.3.0 20170516, 64-bit
Operating system: Windows 10 Version 1903 (OS Build 18362.356)

Activity

  1. hastarin commented on Oct 4, 2019

    @hastarin
    Author

    Adding a reference to System.Text.Json for the VSIX project gets things working again.

  2. austindrenski commented on Oct 4, 2019

    @austindrenski
    Contributor

    @hastarin Thanks for reporting and investigating this. Would you like to submit a PR with the fix?

  3. hastarin commented on Oct 4, 2019

    @hastarin
    Author

    @austindrenski I can do, though it's literally adding a package via NuGet that's needed and likely easier for the relevant person to do on an appropriate branch?

    If you'd like me to sort out a PR, which branch should I use as a base? hotfix/4.1.2?

  4. YohDeadfall commented on Oct 4, 2019

    @YohDeadfall
    Contributor

    Use the dev branch. When a PR gets merged, we will backport it to appropriate releases.

  5. austindrenski commented on Oct 4, 2019

    @austindrenski
    Contributor

    @hastarin wrote:

    I can do, though it's literally adding a package via NuGet that's needed and likely easier for the relevant person to do on an appropriate branch?

    In the spirit of Hacktoberfest, we want to encourage new contributors to submit PRs, if they're interested and have the time. 🎃 🎃 🎃

  6. DaithiBradley commented on Oct 4, 2019

    @DaithiBradley

    I am also having this issue "Npsql.TypeMapping.GlobalTypeMapper threw an exception" is there an update available for download?

  7. added this to the 4.1.2 milestone on Oct 4, 2019
  8. roji commented on Oct 5, 2019

    @roji
    Member

    I just sat down and mondernized the entire build process for the VSIX extension (#2676), it's been long overdue. It now resembles a normal project as much as a VSIX can, I think :) The dependency on Npgsql is now just a regular project reference, no need to manually specify transitive dependencies any more. All VS stuff is now also included via nugets instead of packages.config.

    @austindrenski this could also make it easier to build this in CI, for Github Actions.

    I'll have a new, working VSIX for 4.1.1 online soon.

  9. changed the title [-]TypeInitializationException loading Microsoft.Bcl.AsyncInterfaces in GlobalTypeMapper.SetupGlobalTypeMapper[/-] [+]VSIX is broken in 4.1.0 and 4.1.1[/+] on Oct 5, 2019
  10. 16 remaining items

  11. modified the milestones: 4.1.2, 4.1.3 on Nov 14, 2019
  12. EDM-APP commented on Jan 15, 2020

    @EDM-APP

    I tried to rollback to vsix 4.0.2,
    To do so i uninstalled npgsql version 4.1.2 from programs,
    Uninstaled Extention 4.1.1.2 in VS 2019

    Then i installed npgsql 4.0.2
    But when i tried to install vsix 4.0.2 it says it is allready installed

    When i open VS2019 and try to open a database, Postgres Database option is no longer there
    and when i try to update model from database it says ddex provider for npgsql does not exist

    How can i reinstall it? The older versions are not in the MarketPlace

    Thanks

  13. EDM-APP commented on Jan 16, 2020

    @EDM-APP

    I tried to rollback to vsix 4.0.2,
    To do so i uninstalled npgsql version 4.1.2 from programs,
    Uninstaled Extention 4.1.1.2 in VS 2019

    Then i installed npgsql 4.0.2
    But when i tried to install vsix 4.0.2 it says it is allready installed

    When i open VS2019 and try to open a database, Postgres Database option is no longer there
    and when i try to update model from database it says ddex provider for npgsql does not exist

    How can i reinstall it? The older versions are not in the MarketPlace

    Thanks

    Hello I Finally fixed it, it came from an old vsix install, Here are the steps

    • Check machine.config has no reference to npgsql
      (If you change it keep a backup and if it breaks your Framework you may need to reinstall it
      I got lucky, i had a pending VS 2019 update that did the trick)
    • Check desenv.config has no reference to npgsql
    • Check VS PrivateAssemblies folder does not contain Npgsql.dll
    • Check GAC does not contain Npgsql.dll
    • Update Npgsql to 4.1.2
    • Update EntityFramework6.Npgsql to 3.2.1.1
    • Update Npgsql Extention to 4.1.1.2
    • Restart Machine

    => You are good to go :-)

  14. modified the milestones: 4.1.3, 4.1.4 on Jan 24, 2020
  15. modified the milestones: 4.1.4, 4.1.5 on Jul 19, 2020
  16. modified the milestones: 4.1.5, Backlog on Sep 28, 2020
  17. YohDeadfall commented on Sep 28, 2020

    @YohDeadfall
    Contributor

    Moved to backlog too to avoid jump between milestones.

  18. Shanayara commented on Dec 8, 2020

    @Shanayara

    @MagicAndre1981 sorry about this. I've prepared a new VSIX referencing VS2017 nupkgs in the 4.1.1 release, can you please give this one a try before I upload it to the VS Marketplace?

    Note: while this should work on VS2017, it will not work on earlier versions because packages aren't available for those.

    Just as a heads up: the Marketplace still says "Works with Visual Studio 2015, 2017, 2019" so if this is intended to no longer work on 2015, it would be good to update the description there to reflect this.

    It's also (factually) still broken on Marketplace VS2017 despite you claiming to support it - the VSIX you posted to Github works, but the Marketplace version does not, see #2897.

  19. added theissue type on Jun 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions