【发布时间】:2020-02-21 01:08:12
【问题描述】:
使用 Visual Studio 2017 尝试使用服务器资源管理器添加到 Postgres 数据库的连接。单击测试连接。问题显示错误:“Npgsql.TypeMapping.GlobalTypeMapper”的类型初始化程序引发异常。
在此之前,我安装了 System.Runtime.CompilerServices.Unsafe v4.5.2 和 System.Numerics.Vectors v4.4.0 以修复错误消息“无法加载文件或程序集 'System.Runtime.CompilerServices.Unsafe, Version=4.0 .4.1" 并且无法加载文件或程序集 'System.Numerics.Vectors, Version=4.1.3.0。
我不知道要修复这个“'Npgsql.TypeMapping.GlobalTypeMapper' 的类型初始化程序引发了异常。”
我只想将 PostgreSQL 数据库的连接添加到 Visual Studio 2017。我已经在 postgres 中有一个数据库...我不知道我要先安装什么来添加该连接。
在 Visual Studio=>Tools=> Extension 中安装 Npgsql PostgresSQL Integration 并更新后,我创建了新项目并直接进入 Manage Nuget Packages 并安装了 System.Runtime.CompilerServices.Unsafe v4.5.2 和 System.Numerics.Vectors v4.4.0。 我直接尝试在服务器资源管理器中添加连接。 我对此一无所知。我只是想在visual studio中添加postgres的数据连接,这样我就可以添加ADO.NET Entity Data模型了。
更多技术细节 .NET 框架 4.6.1 Npgsql 版本 4.1.1.2
【问题讨论】:
-
this is also a known bug。每次有错误请搜索github
标签: .net postgresql visual-studio dll npgsql