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

Closed
opened 2026-02-26 17:37:29 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Corsinvest/cv4pve-admin/pull/147
Author: @franklupo
Created: 2/16/2026
Status: Merged
Merged: 2/16/2026
Merged by: @franklupo

Base: mainHead: fix/ef-design-time-buildinfo


📝 Commits (1)

  • df2222c fix: skip BuildInfo initialization when running EF tools at design-time

📊 Changes

1 file changed (+2 additions, -0 deletions)

View changed files

📝 src/Corsinvest.ProxmoxVE.Admin.Core/BuildInfo.cs (+2 -0)

📄 Description

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

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Corsinvest/cv4pve-admin/pull/147 **Author:** [@franklupo](https://github.com/franklupo) **Created:** 2/16/2026 **Status:** ✅ Merged **Merged:** 2/16/2026 **Merged by:** [@franklupo](https://github.com/franklupo) **Base:** `main` ← **Head:** `fix/ef-design-time-buildinfo` --- ### 📝 Commits (1) - [`df2222c`](https://github.com/Corsinvest/cv4pve-admin/commit/df2222c7094cd9991cf5180272a1c5abbc7bfffe) fix: skip BuildInfo initialization when running EF tools at design-time ### 📊 Changes **1 file changed** (+2 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `src/Corsinvest.ProxmoxVE.Admin.Core/BuildInfo.cs` (+2 -0) </details> ### 📄 Description ## 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 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-26 17:37:29 +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#140
No description provided.