根据以上代码执行的时候报错:PS C:\build64\project\UDB-Test\EF6PostgreSQLDemo> dotnet run
C:\build64\project\UDB-Test\EF6PostgreSQLDemo\EF6PostgreSQLDemo.csproj : warning NU1608: 检测到的包版本在依赖项约束 之外: Npgsql.En
tityFramework 2.2.7 需要 Npgsql (= 2.2.7),但版本 Npgsql 9.0.3 已解决。
C:\build64\project\UDB-Test\EF6PostgreSQLDemo\EF6PostgreSQLDemo.csproj : warning NU1701: 已使用“.NETFramework,Version=
v4.6.1, .NETFramework,Version=v4.6.2, .NETFramework,Version=v4.7, .NETFramework,Version=v4.7.1, .NETFramework,Versi
on=v4.7.2, .NETFramework,Version=v4.8, .NETFramework,Version=v4.8.1”而不是项目目标框架“net8.0”还原包“EntityFramework 6.0.0”。此包可
能与项目不完全兼容。
C:\build64\project\UDB-Test\EF6PostgreSQLDemo\EF6PostgreSQLDemo.csproj : warning NU1701: 已使用“.NETFramework,Version=
v4.6.1, .NETFramework,Version=v4.6.2, .NETFramework,Version=v4.7, .NETFramework,Version=v4.7.1, .NETFramework,Versi
on=v4.7.2, .NETFramework,Version=v4.8, .NETFramework,Version=v4.8.1”而不是项目目标框架“net8.0”还原包“Npgsql.EntityFramework 2.2
.7”。此包可能与项目不完全兼容。
C:\build64\project\UDB-Test\EF6PostgreSQLDemo\EF6PostgreSQLDemo.csproj : warning NU1608: 检测到的包版本在依赖项约束 之外: Npgsql.En
tityFramework 2.2.7 需要 Npgsql (= 2.2.7),但版本 Npgsql 9.0.3 已解决。
C:\build64\project\UDB-Test\EF6PostgreSQLDemo\EF6PostgreSQLDemo.csproj : warning NU1701: 已使用“.NETFramework,Version=
v4.6.1, .NETFramework,Version=v4.6.2, .NETFramework,Version=v4.7, .NETFramework,Version=v4.7.1, .NETFramework,Versi
on=v4.7.2, .NETFramework,Version=v4.8, .NETFramework,Version=v4.8.1”而不是项目目标框架“net8.0”还原包“EntityFramework 6.0.0”。此包可
能与项目不完全兼容。
C:\build64\project\UDB-Test\EF6PostgreSQLDemo\EF6PostgreSQLDemo.csproj : warning NU1701: 已使用“.NETFramework,Version=
v4.6.1, .NETFramework,Version=v4.6.2, .NETFramework,Version=v4.7, .NETFramework,Version=v4.7.1, .NETFramework,Versi
on=v4.7.2, .NETFramework,Version=v4.8, .NETFramework,Version=v4.8.1”而不是项目目标框架“net8.0”还原包“Npgsql.EntityFramework 2.2
.7”。此包可能与项目不完全兼容。
C:\build64\project\UDB-Test\EF6PostgreSQLDemo\SysUser.cs(11,23): warning CS8618: 在退出构造函数时,不可为 null 的 属性 "UserName"
必须包含非 null 值。请考虑添加 "required" 修饰符或将该 属性 声明为可为 null。 [C:\build64\project\UDB-Test\EF6PostgreSQLDemo\EF6PostgreSQLDem
o.csproj]
C:\build64\project\UDB-Test\EF6PostgreSQLDemo\SysUser.cs(12,23): warning CS8618: 在退出构造函数时,不可为 null 的 属性 "Password"
必须包含非 null 值。请考虑添加 "required" 修饰符或将该 属性 声明为可为 null。 [C:\build64\project\UDB-Test\EF6PostgreSQLDemo\EF6PostgreSQLDem
o.csproj]
C:\build64\project\UDB-Test\EF6PostgreSQLDemo\AppContext.cs(7,16): warning CS8618: 在退出构造函数时,不可为 null 的 属性 "Users" 必
须包含非 null 值。请考虑添加 "required" 修饰符或将该 属性 声明为可为 null。 [C:\build64\project\UDB-Test\EF6PostgreSQLDemo\EF6PostgreSQLDemo
.csproj]
Unhandled exception. System.TypeInitializationException: The type initializer for 'System.Data.Entity.Internal.AppConfig' threw an exception.
---> System.IO.FileNotFoundException: Could not load file or assembly 'System.Configuration.ConfigurationManager, Version=0.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. 系统找不到指定的文件。
File name: 'System.Configuration.ConfigurationManager, Version=0.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'
at System.Data.Entity.Internal.AppConfig..ctor()
at System.Data.Entity.Internal.AppConfig..cctor()
--- End of inner exception stack trace ---
at System.Data.Entity.Internal.AppConfig.get_DefaultInstance()
at System.Data.Entity.Internal.LazyInternalConnection..ctor(String nameOrConnectionString)
at System.Data.Entity.DbContext..ctor(String nameOrConnectionString)
at EF6PostgreSQLDemo.AppContext..ctor() in C:\build64\project\UDB-Test\EF6PostgreSQLDemo\AppContext.cs:line 7
at EF6PostgreSQLDemo.Program.Main(String[] args) in C:\build64\project\UDB-Test\EF6PostgreSQLDemo\Program.cs:line 10
PS C:\build64\project\UDB-Test\EF6PostgreSQLDemo>
最新发布