Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Expand Minimize
Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here.

CodeSnippet Element (IntelliSense Code Snippets) 

Allows you to specify a heading and multiple IntelliSense Code Snippets, which you can insert into Visual Studio 2005 code files.

<CodeSnippet Format="x.x.x">
    <Header>... </Header>
    <Snippet>... </Snippet>

The following sections describe attributes, child elements, and parent elements.


Attribute Description


Required attribute.

Specifies the schema version of the code snippet. The Format attribute must be a string in the syntax of x.x.x, where each "x" represents a numerical value of the version number. Visual Studio will ignore code snippets with Format attributes that it does not understand.

Child Elements

Element Description


Required element.

Contains general information about the code snippet. There must be exactly one Header element in a code snippet.


Required element.

Contains the code that will be inserted by Visual Studio. There must be exactly one Snippet element in a code snippet.

Parent Elements

Element Description


Root element of the code snippet XML schema.

The following code shows a code snippet targeting version 1.0.0 of the code snippet XML schema.

<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
    <CodeSnippet Format="1.0.0">
            <!-- Insert header information here -->
            <!-- Insert snippet information here -->

Community Additions

© 2015 Microsoft