Tôi đang làm việc với SQLite. Tôi có thể sử dụng Entity Framework 6.1.3 trong ứng dụng WPF của tôi không có vấn đề, nhưng khi tôi cập nhật nó để 6.2.0 Tôi nhận được lỗi sau:Cập nhật lên EF 6.2.0 từ EF 6.1.3 nguyên nhân không thể truy cập lỗi đối tượng được xử lý
Test method DataAccessLayerTests.GenericDataRepositoryTests.CRUD_On_Pipe threw exception:
System.ObjectDisposedException: Cannot access a disposed object.
Object name: 'SQLiteConnection'.
at System.Data.SQLite.SQLiteConnection.CheckDisposed()
at System.Data.SQLite.SQLiteConnection.get_State()
at System.Data.Entity.Internal.RepositoryBase.CreateConnection()
at System.Data.Entity.Migrations.History.HistoryRepository.QueryExists(String contextKey)
at System.Data.Entity.Migrations.History.HistoryRepository.Exists(String contextKey)
at System.Data.Entity.Migrations.History.HistoryRepository.GetPendingMigrations(IEnumerable`1 localMigrations)
at System.Data.Entity.Migrations.DbMigrator.GetPendingMigrations()
at Core.DatabaseContext.CreateAndSeedIfNotExists`1.InitializeDatabase(T context) in C:\Users\roadrunner\propulsimcs\Propulsim\Core\DatabaseContext.cs:line 40
at System.Data.Entity.Internal.InternalContext.<>c__DisplayClassf`1.<CreateInitializationAction>b__e()
at System.Data.Entity.Internal.InternalContext.PerformInitializationAction(Action action)
at System.Data.Entity.Internal.InternalContext.PerformDatabaseInitialization()
at System.Data.Entity.Internal.LazyInternalContext.<InitializeDatabase>b__4(InternalContext c)
at System.Data.Entity.Internal.RetryAction`1.PerformAction(TInput input)
at System.Data.Entity.Internal.LazyInternalContext.InitializeDatabaseAction(Action`1 action)
at System.Data.Entity.Internal.LazyInternalContext.InitializeDatabase()
at System.Data.Entity.Internal.InternalContext.Initialize()
at System.Data.Entity.Database.Initialize(Boolean force)
at Core.DatabaseContext..ctor() in C:\Users\roadrunner\propulsimcs\Propulsim\Core\DatabaseContext.cs:line 114
at DataAccessLayer.GenericDataRepository`1.GetAll(Expression`1[] navigationProperties) in C:\Users\roadrunner\propulsimcs\Propulsim\DataAccessLayer\GenericDataRepository.cs:line 16
at DataAccessLayerTests.GenericDataRepositoryTests.CRUD_On_Pipe() in C:\Users\roadrunner\propulsimcs\Propulsim\DataAccessLayerTests\GenericDataRepositoryTests.cs:line 34
Debug Trace:
Native library pre-loader is trying to load native SQLite library "C:\Users\roadrunner\propulsimcs\Propulsim\DataAccessLayerTests\bin\Debug\x86\SQLite.Interop.dll"...
Bất kỳ ý tưởng?
Vui lòng hiển thị cho chúng tôi mã nguồn cho 'CRUD_On_Pipe' và' GetAll'. – mjwills
@mjwills Có Tôi đã cập nhật cả dự án ứng dụng và thử nghiệm. – ferit
@mjwills Cập nhật câu hỏi với các mã nguồn đó. – ferit