[codex] Fall back when process path inspection fails#233
Conversation
PR Review: Fall back when process path inspection failsThe change is small, focused, and correctly addresses the Sentinel 1 EDR crash reported in #188. A few observations: What's good
Minor issues1. Silent swallowing of
catch (InvalidOperationException)
{
// Process has exited or its module list is unavailable; fall through to assembly-based path.
}2. This is a pre-existing issue, not introduced by this PR, but worth noting since the PR increases the likelihood of hitting the fallback: location = AppContext.BaseDirectory; // e.g. "C:\MyApp\" — a directory string
3. var assembly =
Assembly.GetEntryAssembly() ??
throw new InvalidOperationException("Entry assembly is not found.");If both OverallThe fix is correct and appropriate for the problem it solves. The two pre-existing edge cases above (#2 and #3) are out of scope for this PR — just something to track for a follow-up if users encounter them. The Verdict: Good to merge after addressing the comment wording nit (optional). |
Summary
Process.MainModuleas a hard requirement when deriving the tray icon GUIDWhy
On some systems, endpoint protection or memory-protection features cause
Process.MainModuleto throw whileTaskbarIconis initializing. That currently crashes the constructor path even though the library already has alternate ways to derive a stable process path.Validation
dotnet build src/libs/H.NotifyIcon/H.NotifyIcon.csproj --configuration Release /p:GeneratePackageOnBuild=falsedotnet build src/libs/H.NotifyIcon.Wpf/H.NotifyIcon.Wpf.csproj --configuration Release /p:GeneratePackageOnBuild=falseFixes #188