diff --git a/LiteDB/Engine/Engine/Rebuild.cs b/LiteDB/Engine/Engine/Rebuild.cs index 959205fc3..a5c9b580b 100644 --- a/LiteDB/Engine/Engine/Rebuild.cs +++ b/LiteDB/Engine/Engine/Rebuild.cs @@ -64,7 +64,7 @@ public long Rebuild(RebuildOptions options) _disk.Write(new[] { _header.UpdateBuffer() }, FileOrigin.Data); // set new fileLength - _disk.SetLength((_header.LastPageID + 1) * PAGE_SIZE, FileOrigin.Data); + _disk.SetLength((long)(_header.LastPageID + 1) * PAGE_SIZE, FileOrigin.Data); // get new filelength to compare var newLength = _disk.GetVirtualLength(FileOrigin.Data);