Visual basic DebuggerNonUserCodeAttribute, how and why is it used.

Posted on 2011-04-24
Last Modified: 2012-05-11
what does the statement System.Diagnostics.DebuggerNonUserCodeAttribute(), _
         System.ComponentModel.DataObjectMethodAttribute(System.ComponentModel.DataObjectMethodType.Delete, False) do before a function?

Question by:atomicgs12
    LVL 33

    Accepted Solution

    They are attributes - attributes describe objects, methods, properties, etc.  For example, you might use the "DllImportAttribute" on a method to tell the compiler that it's actually a function in a DLL; or the "SerializableAttribute" to tell the compiler that the class it's applied to can be serialized into an XML file.

    These two attributes look like they're automatically applied by Visual Studio to code that Visual Studio maintains for you (like the code that describes the layout of a form), so you probably don't need to be concerned with them.




    Author Comment

    Makes sense. So how does a function like:
    <System.Diagnostics.DebuggerNonUserCodeAttribute(),_ System.ComponentModel.DataObjectMethodAttribute(System.ComponentModel.DataObjectMethodType.Delete, False)> _
            Public Overridable Overloads Function DeleteOlderThan(ByVal CutOff As System.Nullable(Of Date)) As Integer
    get autogenerated? What tool might be used? Of course this is related to a database.
    LVL 33

    Expert Comment

    by:Todd Gerbert
    Probably the result of adding an Entity Framework object.  Normally you wouldn't mess the the .vb files though - like when you want to add a button to a form you don't edit the Form1.Designer.vb file by hand, you use the designer to drag a button from the toolbox onto your form.

    Featured Post

    What Is Threat Intelligence?

    Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

    Join & Write a Comment

    Suggested Solutions

    Introduction In a recent article ( for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
    When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
    Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
    Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

    729 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now