[PR #147] fix: skip BuildInfo initialization when running EF tools at design-time #279

Closed
opened 2026-03-07 19:57:11 +03:00 by kerem · 0 comments
Owner

Original Pull Request: https://github.com/Corsinvest/cv4pve-admin/pull/147

State: closed
Merged: Yes


Summary

  • BuildInfo static constructor crashes at EF design-time because the entry assembly is ef.dll (no EditionAttribute)
  • Added guard if (ApplicationHelper.IsRunningInEfTool) { return; } to skip initialization when running EF CLI tools

Test plan

  • Run dotnet ef migrations add ... — should succeed without NullReferenceException
  • Normal app startup — BuildInfo properties still populated correctly
**Original Pull Request:** https://github.com/Corsinvest/cv4pve-admin/pull/147 **State:** closed **Merged:** Yes --- ## Summary - `BuildInfo` static constructor crashes at EF design-time because the entry assembly is `ef.dll` (no `EditionAttribute`) - Added guard `if (ApplicationHelper.IsRunningInEfTool) { return; }` to skip initialization when running EF CLI tools ## Test plan - [ ] Run `dotnet ef migrations add ...` — should succeed without `NullReferenceException` - [ ] Normal app startup — `BuildInfo` properties still populated correctly
kerem 2026-03-07 19:57:11 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/cv4pve-admin#279
No description provided.