Application Control policy error when running code

Roman Ward 0 Reputation points
2026-11-24T09:07:28.76+00:00

When I try to run my C code on VSCode, I get this error:

User's image

When I have searched about it, it just tells me to disable SmartApp control, but I don't really want to do this.

Is there any alternative to fix this?

Any help would be much appreciated.

Microsoft Security | Microsoft Defender | Other
0 comments No comments

1 answer

Sort by: Most helpful
  1. AI answer

    2026-11-24T09:08:33.2533333+00:00

    Keep Smart App Control enabled by signing each GCC-generated executable with a valid code-signing certificate from a trusted provider; Smart App Control does not support per-file or per-app exceptions.

    Confirm which policy is blocking the executable

    Open Windows Security → App & browser control → Smart App Control settings:

    • On means Smart App Control is enforcing its trust requirements.
    • Evaluation means Smart App Control should not currently block applications.
    • If the Smart App Control section is absent, or this is an organization-managed computer, another Application Control policy may be responsible.

    In enforcement mode, Smart App Control permits code recognized as safe by Microsoft's intelligence service or signed with a trusted certificate. A newly compiled test1.exe is unknown and normally unsigned, so it can be blocked even though you wrote its source code yourself.^1^

    Supported alternative: sign the generated executable

    1. Obtain a code-signing certificate from a trusted certificate provider, or use Microsoft Artifact Signing. A locally created self-signed/test certificate is not publicly trusted and therefore is not a substitute for a trusted production certificate.^2^
    2. Compile the program as usual.
    3. Sign the resulting .exe before running it. Microsoft documents Artifact Signing as the preferred option; signtool.exe, included with Visual Studio, can also sign with a certificate installed in your certificate store.^3^
    4. Repeat signing whenever recompilation replaces the executable.

    For example, when using an installed trusted certificate with SignTool:

    gcc .\test1.c -o .\test1.exe
    
    $thumbprint = "<code-signing-certificate-thumbprint>"
    signtool sign /sha1 $thumbprint /fd SHA256 .\test1.exe
    signtool verify /pa /v .\test1.exe
    
    .\test1.exe
    

    The certificate must chain to a certificate authority in the Microsoft Trusted Root Program; merely applying any signature is insufficient.^3^

    If trusted signing is impractical

    There is currently no supported Allow anyway, exclusion list, folder exemption, or one-file bypass for Smart App Control. Microsoft's documented choices are to sign the executable with a valid trusted certificate or turn Smart App Control off.^4^

    For frequent local development, production-grade signing on every build may be impractical. In that case, keeping Smart App Control enabled means running unsigned development builds in a separate development environment—such as another development computer or VM where Smart App Control is not enforcing—rather than weakening protection on the primary installation.

    If Smart App Control is not On, the message likely comes from a different Application Control policy. On a managed device, ask the administrator to identify the active App Control for Business policy and approve the compiler/output appropriately; Smart App Control itself is disabled on enterprise-managed devices.^5^


    References

    1. Smart App Control overview
    2. Artifact Signing trust models
    3. Sign your app for Smart App Control compliance
    4. Smart App Control Frequently Asked Questions | Microsoft Support
    5. Smart App Control
    AI-generated content may be incorrect. Read our transparency notes for more information.

    Was this answer helpful?

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.