Bug fix #250 : recent refactor introduced a race condition for db creation on initial install. Moved db creation to before all other init/config is called
This commit is contained in:
parent
72e667e825
commit
051fa0a28f
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net6.0-windows</TargetFramework>
|
<TargetFramework>net6.0-windows</TargetFramework>
|
||||||
<Version>7.6.0.1</Version>
|
<Version>7.6.1.1</Version>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|||||||
@ -30,6 +30,10 @@ namespace LibationWinForms
|
|||||||
gridPanel.Controls.Add(productsGrid);
|
gridPanel.Controls.Add(productsGrid);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Pre-requisite:
|
||||||
|
// Before calling anything else, including subscribing to events, ensure database exists. If we wait and let it happen lazily, race conditions and errors are likely during new installs
|
||||||
|
using var _ = DbContexts.GetContext();
|
||||||
|
|
||||||
this.Load += (_, _) => this.RestoreSizeAndLocation(Configuration.Instance);
|
this.Load += (_, _) => this.RestoreSizeAndLocation(Configuration.Instance);
|
||||||
this.FormClosing += (_, _) => this.SaveSizeAndLocation(Configuration.Instance);
|
this.FormClosing += (_, _) => this.SaveSizeAndLocation(Configuration.Instance);
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user