Skip to content

App fails to start on Windows 11 with Smart App Control enabled: unsigned Microsoft.Xaml.Behaviors.dll blocked by Code Integrity (0x800711C7) #1483

Open

Description

@susaglam

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

  1. Fresh Windows 11 Pro (SAC on by default).
  2. winget install dnGrep.dnGrep.
  3. Launch dnGrep from Start menu or C:\Program Files\dnGrep\dnGREP.exe.
  4. 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

  1. doug24 commented on May 23, 2026

    @doug24
    Contributor

    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.

  2. doug24 commented on May 25, 2026

    @doug24
    Contributor

    @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.

  3. susaglam commented on May 26, 2026

    @susaglam
    Author

    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:

    • Some users on personal machines can disable SAC (and as of the April 2026 update, apparently without a full Windows reinstall, which helps a little).
    • Users on company-issued laptops typically can't touch settings like this — corporate IT policies lock it down.
    • The same applies to school-managed devices and standardized enterprise images.
  4. VladTester255 commented on May 27, 2026

    @VladTester255
    Contributor

    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.

  5. doug24 commented on May 27, 2026

    @doug24
    Contributor

    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.

  6. fade2gray commented on May 27, 2026

    @fade2gray

    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\, toggle VerifiedAndReputablePolicyState 1/0 (on/off)

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions