{"title":"NonDebuggable attribute","url":"https://jonas-paprotka.de/docs/dev-itpro/developer/attributes/devenv-nondebuggable-attribute/","by":"JOP-AL","license":"Copyright (c) Microsoft Corporation. CC BY 4.0, https://creativecommons.org/licenses/by/4.0/; code samples MIT. From https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/attributes/devenv-nondebuggable-attribute, MicrosoftDocs/dynamics365smb-devitpro-pb at 828b6ee (2026-11-19). Changed: includes filled in, links to this site, and for agents shortened without dropping a fact.","credit":"Microsoft Corporation, CC BY 4.0","origin":"https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/attributes/devenv-nondebuggable-attribute","source":{"name":"Business Central developer and IT pro docs","repo":"https://github.com/MicrosoftDocs/dynamics365smb-devitpro-pb","commit":"828b6ee72fcd75755627cd6011f3d20899217ab2","date":"2026-11-19"},"checked":"2026-11-19","description":"Specifies that the annotated symbol will not be available to the debugger.","date":"2026-10-01","meta":{"topic":"reference"},"outline":[{"level":2,"title":"Applies to","slug":"applies-to","at":207,"chars":32},{"level":2,"title":"Syntax","slug":"syntax","at":239,"chars":36},{"level":2,"title":"Example","slug":"example","at":275,"chars":544},{"level":2,"title":"Remarks","slug":"remarks","at":819,"chars":356},{"level":2,"title":"Related information","slug":"related-information","at":1175,"chars":87}],"text":"> Version: _Available or changed with runtime version 2.0._\nSpecifies that the annotated symbol will not be available to the debugger. E.g. methods can't be stepped through and variables can't be inspected.\n## Applies to\n Variable\n Method\n## Syntax\n```al\n[NonDebuggable]\n```\n## Example\nAdd `[NonDebuggable]` to each method that you want to hide from the debugger.\n```al\ncodeunit 50142 NoDebuggingOfMethod\n{\n    [NonDebuggable]\n    local procedure MyProcedure()\n    var\n        myInt: Integer;\n    begin\n        //Make something happen\n    end;\n}\n\n```\nAdd `[NonDebuggable]` to each variable that you want to hide from the debugger.\n```al\ncodeunit 50143 NoDebuggingOfVar\n{\n    local procedure MyProcedure()\n    var\n        [NonDebuggable]\n        myInt: Integer;\n    begin\n        //Make something happen\n    end;\n}\n\n```\n## Remarks\nRegardless of the resource exposure policy setting, methods and variables marked with `[NonDebuggable]` remain unavailable to the debugger.\n> NOTE\n> Snapshot debugging collects frames for non-debuggable methods but doesn't show their variables at snap points.\nSee Resource Exposure Policy Setting<../devenv-security-settings-and-ip-protection>.\n## Related information\nAL method reference<../methods-auto/library>\n../devenv-debugging"}