Hi,
When you are receiving several emails and at the same time you are trying to access contents from the WebUI. The application throw an unhandled exception.
Version Used: 3.0.349 Win x64
Logs:
`
F:\Program Files\Smtp4dev>"Rnwood.Smtp4dev.exe" --server.urls "http://0.0.0.0:50
00/"
smtp4dev version 3.0.0.0
https://github.com/rnwood/smtp4dev
Using Sqlite database at F:\Program Files\Smtp4dev\database.db
SMTP Server is listening on port 25. Keeping last 100 messages and 100 sessions.
Hosting environment: Production
Content root path: F:\Program Files\Smtp4dev
Now listening on: http://0.0.0.0:5000
Application started. Press Ctrl+C to shut down.
Session started. Client address XX.XX.XX.XX
Session started. Client address XX.XX.XX.XX
Session started. Client address XX.XX.XX.XX
Session started. Client address XX.XX.XX.XX
Session started. Client address XX.XX.XX.XX
Session started. Client address XX.XX.XX.XX
Session started. Client address XX.XX.XX.XX
Session started. Client address XX.XX.XX.XX
Session started. Client address XX.XX.XX.XX
Session started. Client address XX.XX.XX.XX
Session started. Client address XX.XX.XX.XX
Session started. Client address XX.XX.XX.XX
Session started. Client address XX.XX.XX.XX
Session started. Client address XX.XX.XX.XX
Session started. Client address XX.XX.XX.XX
Session started. Client address XX.XX.XX.XX
Session started. Client address XX.XX.XX.XX
Session started. Client address XX.XX.XX.XX
Session started. Client address XX.XX.XX.XX
Session started. Client address XX.XX.XX.XX
Session started. Client address XX.XX.XX.XX
Session started. Client address XX.XX.XX.XX
Session started. Client address XX.XX.XX.XX
Session started. Client address XX.XX.XX.XX
Session started. Client address XX.XX.XX.XX
Session started. Client address XX.XX.XX.XX
Session started. Client address XX.XX.XX.XX
Session completed. Client address XX.XX.XX.XX. Number of messages 4
Session started. Client address XX.XX.XX.XX
Session started. Client address XX.XX.XX.XX
Session completed. Client address XX.XX.XX.XX. Number of messages 5
Session started. Client address XX.XX.XX.XX
Session started. Client address XX.XX.XX.XX
Session completed. Client address XX.XX.XX.XX. Number of messages 4
Session started. Client address XX.XX.XX.XX
Session completed. Client address XX.XX.XX.XX. Number of messages 5
Session completed. Client address XX.XX.XX.XX. Number of messages 5
Session started. Client address XX.XX.XX.XX
Session started. Client address XX.XX.XX.XX
Unhandled Exception: fail: Microsoft.EntityFrameworkCore.Update[10000]
An exception occurred in the database while saving changes for context typ
e 'Rnwood.Smtp4dev.DbModel.Smtp4devDbContext'.
Microsoft.EntityFrameworkCore.DbUpdateConcurrencyException: Database opera
tion expected to affect 1 row(s) but actually affected 0 row(s). Data may have b
een modified or deleted since entities were loaded. See http://go.microsoft.com/
fwlink/?LinkId=527962 for information on understanding and handling optimistic c
oncurrency exceptions.
at Microsoft.EntityFrameworkCore.Update.AffectedCountModificationComman
dBatch.ThrowAggregateUpdateConcurrencyException(Int32 commandIndex, Int32 expect
edRowsAffected, Int32 rowsAffected)
at Microsoft.EntityFrameworkCore.Update.AffectedCountModificationComman
dBatch.ConsumeResultSetWithoutPropagationAsync(Int32 commandIndex, RelationalDat
aReader reader, CancellationToken cancellationToken)
at Microsoft.EntityFrameworkCore.Update.AffectedCountModificationComman
dBatch.ConsumeAsync(RelationalDataReader reader, CancellationToken cancellationT
oken)
at Microsoft.EntityFrameworkCore.Update.ReaderModificationCommandBatch.
ExecuteAsync(IRelationalConnection connection, CancellationToken cancellationTok
en)
at Microsoft.EntityFrameworkCore.Update.Internal.BatchExecutor.ExecuteA
sync(DbContext _, ValueTuple2 parameters, CancellationToken cancellationToken) at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.S aveChangesAsync(IReadOnlyList
1 entriesToSave, CancellationToken cancellationTok
en)
at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.S
aveChangesAsync(Boolean acceptAllChangesOnSuccess, CancellationToken cancellatio
nToken)
at Microsoft.EntityFrameworkCore.DbContext.SaveChangesAsync(Boolean acc
eptAllChangesOnSuccess, CancellationToken cancellationToken)
Microsoft.EntityFrameworkCore.DbUpdateConcurrencyException: Database operation e
xpected to affect 1 row(s) but actually affected 0 row(s). Data may have been mo
dified or deleted since entities were loaded. See http://go.microsoft.com/fwlink
/?LinkId=527962 for information on understanding and handling optimistic concurr
ency exceptions.
at Microsoft.EntityFrameworkCore.Update.AffectedCountModificationCommandBatch
.ThrowAggregateUpdateConcurrencyException(Int32 commandIndex, Int32 expectedRows
Affected, Int32 rowsAffected)
at Microsoft.EntityFrameworkCore.Update.AffectedCountModificationCommandBatch
.ConsumeResultSetWithoutPropagationAsync(Int32 commandIndex, RelationalDataReade
r reader, CancellationToken cancellationToken)
at Microsoft.EntityFrameworkCore.Update.AffectedCountModificationCommandBatch
.ConsumeAsync(RelationalDataReader reader, CancellationToken cancellationToken)
at Microsoft.EntityFrameworkCore.Update.ReaderModificationCommandBatch.Execut
eAsync(IRelationalConnection connection, CancellationToken cancellationToken)
at Microsoft.EntityFrameworkCore.Update.Internal.BatchExecutor.ExecuteAsync(D
bContext _, ValueTuple2 parameters, CancellationToken cancellationToken) at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.SaveCha ngesAsync(IReadOnlyList
1 entriesToSave, CancellationToken cancellationToken)
at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.SaveCha
ngesAsync(Boolean acceptAllChangesOnSuccess, CancellationToken cancellationToken
)
at Microsoft.EntityFrameworkCore.DbContext.SaveChangesAsync(Boolean acceptAll
ChangesOnSuccess, CancellationToken cancellationToken)
Microsoft.EntityFrameworkCore.DbUpdateConcurrencyException: Database operation e
xpected to affect 1 row(s) but actually affected 0 row(s). Data may have been mo
dified or deleted since entities were loaded. See http://go.microsoft.com/fwlink
/?LinkId=527962 for information on understanding and handling optimistic concurr
ency exceptions.
at Microsoft.EntityFrameworkCore.Update.AffectedCountModificationCommandBatch
.ThrowAggregateUpdateConcurrencyException(Int32 commandIndex, Int32 expectedRows
Affected, Int32 rowsAffected)
at Microsoft.EntityFrameworkCore.Update.AffectedCountModificationCommandBatch
.ConsumeResultSetWithoutPropagationAsync(Int32 commandIndex, RelationalDataReade
r reader, CancellationToken cancellationToken)
at Microsoft.EntityFrameworkCore.Update.AffectedCountModificationCommandBatch
.ConsumeAsync(RelationalDataReader reader, CancellationToken cancellationToken)
at Microsoft.EntityFrameworkCore.Update.ReaderModificationCommandBatch.Execut
eAsync(IRelationalConnection connection, CancellationToken cancellationToken)
at Microsoft.EntityFrameworkCore.Update.Internal.BatchExecutor.ExecuteAsync(D
bContext _, ValueTuple2 parameters, CancellationToken cancellationToken) at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.SaveCha ngesAsync(IReadOnlyList
1 entriesToSave, CancellationToken cancellationToken)
at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.SaveCha
ngesAsync(Boolean acceptAllChangesOnSuccess, CancellationToken cancellationToken
)
at Microsoft.EntityFrameworkCore.DbContext.SaveChangesAsync(Boolean acceptAll
ChangesOnSuccess, CancellationToken cancellationToken)
at Rnwood.Smtp4dev.Server.Smtp4devServer.OnMessageReceived(Object sender, Mes
sageEventArgs e) in C:\projects\smtp4dev\Rnwood.Smtp4dev\Server\Smtp4devServer.c
s:line 92
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionCo
ntext, ContextCallback callback, Object state)
--- End of stack trace from previous location where exception was thrown ---
at System.Threading.ThreadPoolWorkQueue.Dispatch()
`