Repository navigation
Description
Summary
dnGrep 4.7.54.0 crashes on startup on a clean Windows 11 Pro system with Smart App Control (SAC) enabled. Windows
Code Integrity blocks the bundled Microsoft.Xaml.Behaviors.dll because it ships unsigned, and SAC enforces an
"Enterprise signing level" requirement on every loaded module. Both the standalone Win32 installer and the MSIX
package fail identically — the MSIX is a sparse package that wraps the same unsigned binaries.
Since SAC is on by default on every fresh Windows 11 install since 22H2, this effectively makes dnGrep unusable
for any new Windows 11 user who hasn't manually disabled SAC (a one-way decision that requires a full Windows reset to
re-enable).
Environment
| Item | Value |
|---|---|
| OS | Windows 11 Pro 10.0.26200 |
| Smart App Control | On (Get-MpComputerStatus → SmartAppControlState) |
| Defender | Real-time protection enabled |
| dnGrep (Win32) | 4.7.54.0 — C:\Program Files\dnGrep\dnGREP.exe |
| dnGrep (MSIX) | 4.7.54.0 — dnGrep_4.7.54.0_neutral__wbnnev551gwxy |
| Install source | winget (dnGrep.dnGrep) |
Repro steps
- Fresh Windows 11 Pro (SAC on by default).
winget install dnGrep.dnGrep.- Launch dnGrep from Start menu or
C:\Program Files\dnGrep\dnGREP.exe. - Application briefly shows an error dialog: "Something broke down in dnGrep. Check the error log…" then exits.
Expected behavior
Application launches normally on a default Windows 11 configuration.
Actual behavior
Grep_Error_Log.xml records:
System.Windows.Markup.XamlParseException: Could not load file or assembly
'C:\Program Files\dnGrep\Microsoft.Xaml.Behaviors.dll'.
An Application Control policy has blocked this file. (0x800711C7)
---> System.IO.FileLoadException: Could not load file or assembly
'C:\Program Files\dnGrep\Microsoft.Xaml.Behaviors.dll'.
An Application Control policy has blocked this file. (0x800711C7)
at System.Reflection.RuntimeAssembly.InternalLoad(...)
...
at dnGREP.WPF.MainForm..ctor(Boolean isVisible) in MainView.xaml.cs:line 41
at dnGREP.WPF.App.Application_Startup(...) in App.xaml.cs:line 121
Matching Windows Event Log entries (Microsoft-Windows-CodeIntegrity/Operational):
Event 3033 / 3077
Code Integrity determined that a process
(\Device\HarddiskVolume3\Program Files\dnGrep\dnGREP.exe)
attempted to load
\Device\HarddiskVolume3\Program Files\dnGrep\Microsoft.Xaml.Behaviors.dll
that did not meet the Enterprise signing level requirements or violated
code integrity policy (Policy ID: {0283ac0f-fff1-49ae-ada1-8a933130cad6}).
{0283ac0f-fff1-49ae-ada1-8a933130cad6} is Microsoft's built-in Smart App Control policy GUID.
Root cause
PS> Get-AuthenticodeSignature "C:\Program Files\dnGrep\Microsoft.Xaml.Behaviors.dll"
Status : NotSigned
StatusMessage : The file is not digitally signed.
SignerCertificate :
Microsoft.Xaml.Behaviors.dll ships unsigned. SAC rejects every unsigned binary load, regardless of which process is
loading it. dnGrep's MainView.xaml references types from this assembly during BAML deserialisation, so the failure
happens before the main window can render — there is no graceful fallback path.
Workarounds attempted (all failed or unacceptable)
┌──────────────────────────────────────────┬──────────────────────────────────────────────────────────────────────┐
│ Workaround │ Result │
├──────────────────────────────────────────┼──────────────────────────────────────────────────────────────────────┤
│ Install MSIX version from winget instead │ Fails — MSIX is a sparse-package wrapper around the same unsigned │
│ of Win32 │ DLLs. │
├──────────────────────────────────────────┼──────────────────────────────────────────────────────────────────────┤
│ Unblock-File on every DLL in the install │ No effect — the file has no Zone.Identifier; the block is from SAC, │
│ dir │ not Mark-of-the-Web. │
├──────────────────────────────────────────┼──────────────────────────────────────────────────────────────────────┤
│ Add C:\Program Files\dnGrep + dnGREP.exe │ No effect. Defender exclusions are documented as not bypassing SAC, │
│ to Microsoft Defender path/process │ and this was confirmed empirically: identical error after exclusion. │
│ exclusions │ │
├──────────────────────────────────────────┼──────────────────────────────────────────────────────────────────────┤
│ │ Works, but is a one-way, system-wide decision that requires a full │
│ Disable Smart App Control │ Windows reinstall to re-enable. Unacceptable as a "just to run a │
│ │ grep tool" remedy. │
└──────────────────────────────────────────┴──────────────────────────────────────────────────────────────────────┘
Suggested fix (in order of preference)
1. Code-sign Microsoft.Xaml.Behaviors.dll before bundling. The upstream NuGet package (Microsoft.Xaml.Behaviors.Wpf)
ships an unsigned assembly inside a signed nupkg — the binary itself carries no Authenticode signature. Re-sign it
with the same certificate already used to sign dnGREP.exe as part of the publish step.
2. Re-sign all third-party DLLs in the install directory as part of the release pipeline. Quick audit:
Get-ChildItem 'C:\Program Files\dnGrep\*.dll' |
ForEach-Object { [PSCustomObject]@{
File = $_.Name
Status = (Get-AuthenticodeSignature $_.FullName).Status
}} | Where-Object Status -ne 'Valid'
2. Any NotSigned / UnknownError row will block SAC users.
3. Switch to a SAC-aware MSIX: a properly signed AppX/MSIX with no sparse-package fallback to unsigned Win32 binaries
is treated by SAC as trusted by virtue of the Microsoft Store / signed installer chain. The current MSIX does not
qualify because it ultimately invokes the unsigned Program Files\dnGrep\dnGREP.exe.
4. Document the SAC incompatibility in the README until (1)–(3) ship, so affected users don't waste cycles diagnosing.
Why this is more urgent than it looks
- SAC enrolment percentage grows with every Windows 11 OOBE (out-of-box experience).
- The dialog shown to the user — "Something broke down in dnGrep. Check the error log" — gives no hint that the OS is
at fault, so most users will assume the app is broken and uninstall.
- There is no first-run banner or telemetry that surfaces this to the dnGrep team, so the install-bounce rate from SAC
users is likely invisible in download metrics.
Attachments
- Full Grep_Error_Log.xml (~5.5 KB) available on request.
- Get-WinEvent output from Microsoft-Windows-CodeIntegrity/Operational covering the failed launches./
[Grep_Error_Log.xml](https://github.com/user-attachments/files/28177387/Grep_Error_Log.xml)
[dngrep-codeintegrity-events.txt](https://github.com/user-attachments/files/28177427/dngrep-codeintegrity-events.txt)
Activity
doug24 commentedon May 23, 2026
Thank-you for your detailed report and analysis. No, I was not aware this was happening. The links at the bottom of your report do not work but I'm not sure that I need to see them.
The more hoops I have to jump through to satisfy Microsoft, the more I feel like just giving up. The era of free software is dead and long gone.
My thoughts: The point of code signing is to verify the file's publisher and ensures it has not been maliciously tampered with since it was created. I did not create Microsoft.Xaml.Behaviors.dll, Microsoft did. Why should I be signing their dll? Microsoft should sign it.
After some googling, it appears the practice is for an application to sign third-party created dlls. This just seems so counter to the purpose to me.
Your powershell script show 10 dlls that are not signed, including the one from 7Zip - is seens odd that 7Zip is not signed given how commonly used it is.
So, I will have to add these dlls to the list of files to sign.
Changing from the msi package to msix will be a much bigger effort, one I'm not sure I'm willing to take on. Is this really necessary to satisfy SAC?
Note: from what I read, as of the April 2026 update, you can toggle SAC on and off without a full windows reinstall. But still, it is not something that users should need to do.
doug24 commentedon May 25, 2026
@susaglam
I'm afraid this is going to be a problem. Users will have to make a choice between SAC and many applications like dnGrep. I will make a note of this in the next release note and add it to dnGrep's main page and help pages.
The code signing certificate dnGrep uses does not allow us to sign dlls that are not written by the project or a fork actively maintained by the project. I think it is highly unlikely that all of the third-party dlls used by dnGrep will be code signed anywhere in the near future - there has been a request to sign 7Zip since 2009. Removing these unsigned dlls would disable many application features.
I asked this question to Microsoft's AI:
Does Microsoft expect most windows 11 users to use Smart Application Control?
Microsoft does not expect most Windows 11 users to use Smart Application Control (SAC).
Based on Microsoft’s own documentation and behavior, SAC is positioned as a consumer‑focused, opt‑in security feature that only works on clean installs, is disabled on enterprise‑managed devices, and is intended for users whose app habits make them a “good fit” — not for the majority of Windows 11 systems.
Microsoft acknowledges SAC may “get in the way” for users with diverse or specialized apps.
susaglam commentedon May 26, 2026
Thank you for taking the time to look into this and for the detailed write-up. dnGrep is an open-source project and I really appreciate you spending your own time tracking down something that ultimately isn't a bug in your code at all.
Your point about third-party DLLs is well taken. It does seem backwards that application maintainers are expected to sign binaries they didn't write — that's exactly the opposite of what code signing was designed to verify. And given that the request to sign 7-Zip has been open since 2009, it's hard to be optimistic that the upstream situation will improve any time soon. Removing those dependencies, as you said, would mean losing significant functionality, so that isn't really an option either.
I think documenting this in the release notes and on the main page is the right move. Users will need to weigh the trade-off themselves, and at least they'll know what they're choosing between. For what it's worth, the user base for a tool like dnGrep is quite varied:
VladTester255 commentedon May 27, 2026
Does the portable version also not work with SAC enabled?
My office has a lot of different PCs and laptops with different OS versions, and I'm sure some of them have SAC enabled, but so far no one has complained about the software not running.
Please check if the portable version works, for example, when running from a USB flash drive.
doug24 commentedon May 27, 2026
I don't have any way to test this since I'm not going to enable SAC on my computer, it would cause complete chaos. But from what I've read, it is any application that attempts to start on the system, it does not matter where the files are located.
fade2gray commentedon May 27, 2026
I'm not suggesting that anyone should try this, but I found a YouTube video explaining how to toggle SAC on or off editing a registry key.
https://www.youtube.com/watch?v=xiIAvXF_FuE
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\CI\Policy\, toggleVerifiedAndReputablePolicyState1/0 (on/off)JohnTHaller commentedon Jun 11, 2026
Smart App Control can be toggled on and off now: https://support.microsoft.com/en-us/windows/smart-app-control-frequently-asked-questions-285ea03d-fa88-4d56-882e-6698afdb7003