You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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)
@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?
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.
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
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
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
@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.
Activity
hastarin commentedon Oct 4, 2019
Adding a reference to System.Text.Json for the VSIX project gets things working again.
austindrenski commentedon Oct 4, 2019
@hastarin Thanks for reporting and investigating this. Would you like to submit a PR with the fix?
hastarin commentedon Oct 4, 2019
@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?
YohDeadfall commentedon Oct 4, 2019
Use the
devbranch. When a PR gets merged, we will backport it to appropriate releases.austindrenski commentedon Oct 4, 2019
@hastarin wrote:
In the spirit of Hacktoberfest, we want to encourage new contributors to submit PRs, if they're interested and have the time. 🎃 🎃 🎃
Added reference to System.Text.Json for VSIX project to fix bug repor…
DaithiBradley commentedon Oct 4, 2019
I am also having this issue "Npsql.TypeMapping.GlobalTypeMapper threw an exception" is there an update available for download?
roji commentedon Oct 5, 2019
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.
[-]TypeInitializationException loading Microsoft.Bcl.AsyncInterfaces in GlobalTypeMapper.SetupGlobalTypeMapper[/-][+]VSIX is broken in 4.1.0 and 4.1.1[/+]16 remaining items
EDM-APP commentedon Jan 15, 2020
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
EDM-APP commentedon Jan 16, 2020
Hello I Finally fixed it, it came from an old vsix install, Here are the steps
(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)
=> You are good to go :-)
YohDeadfall commentedon Sep 28, 2020
Moved to backlog too to avoid jump between milestones.
Shanayara commentedon Dec 8, 2020
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.