Skip to content

"Something broke down in dnGrep" when launched from a folder's context menu in Win10 #1476

Closed

Description

@DaPa

Portable dnGrep (4.7.54.0 and earlier) in Windows 10 crashes when launched from a folder's context menu (in this example from D:\work) with:

Something broke down in dnGrep. Check the error log for details: D:\Tools\search\dnGrep\logs

D:\Tools\search\dnGrep\logs\Grep_Error_Log.xml shows:

<logevent time="2026-05-14 16:56:37.7761" level="Info" logger="dnGREP.WPF.CommandLineArgs">
  <message>Command line arguments: &quot;D:\Tools\search\dnGrep\dnGREP.exe&quot; &quot;D:\work&quot;</message>
</logevent>
<logevent time="2026-05-14 16:56:38.1974" level="Error" logger="dnGREP.WPF.App">
  <message>Failure in application startup</message>
  <exception>System.IO.FileNotFoundException: Could not find file &apos;D:\nGREP.ico&apos;.
File name: &apos;D:\nGREP.ico&apos;
   at Microsoft.Win32.SafeHandles.SafeFileHandle.CreateFile(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options)
   at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Nullable`1 unixCreateMode)
   at System.IO.Strategies.OSFileStreamStrategy..ctor(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Nullable`1 unixCreateMode)
   at System.IO.Strategies.FileStreamHelpers.ChooseStrategyCore(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Nullable`1 unixCreateMode)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)
   at System.Drawing.Icon..ctor(String fileName, Int32 width, Int32 height)
   at dnGREP.WPF.MainForm..ctor(Boolean isVisible)
   at dnGREP.WPF.App.Application_Startup(Object sender, StartupEventArgs e)</exception>
</logevent>

In Process Explorer I see:

Path = D:\Tools\search\dnGrep\dnGREP.exe
Command line = "D:\Tools\search\dnGrep\dnGREP.exe" "D:\work"
Current directory = D:\

The problem seems to be the "Current directory".
Might be solved by Directory.SetCurrentDirectory(Utils.GetCurrentPath()) in early Application_Startup, but not sure of side effects...

Activity

  1. doug24 commented on May 14, 2026

    @doug24
    Contributor

    Thanks for the report.

    I'm guessing this loading the icon for the notification area - everywhere else it's loading the icon from the embedded resource in the dll, but this one is using the file. Do you have the setting 'MinimizeToNotificationArea' set to true? If so, either edit your dnGrep.Setting.dat file to set it false, or use the Options dialog to turn it off (if you can start dnGrep). This will work around the problem until I can get it fixed for the next release.

  2. DaPa commented on May 14, 2026

    @DaPa
    Author

    Thanks! MinimizeToNotificationArea=false works!

  3. doug24 commented on Jun 10, 2026

    @doug24
    Contributor

    Fixed in v5.0.9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions