C# code snippet does not automatically import namespace
I have code snippet for Dbset<>
<CodeSnippet Format="1.1.0" xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
<Header>
<Title>DbSet</Title>
<Author>Կյանքի Համար</Author>
<Shortcut>dbset</Shortcut>
<Description>Add entity into context </Description>
<SnippetTypes>
<SnippetType>Expansion</SnippetType>
</SnippetTypes>
</Header>
<Snippet>
<Imports>
<Import>
<Namespace>Domain</Namespace>
</Import>
</Imports>
<Declarations>
<Literal>
<ID>entity</ID>
<ToolTip>Entity</ToolTip>
<Default>Entity</Default>
</Literal>
</Declarations>
<Code Language="csharp">
<![CDATA[public DbSet<$entity$> $entity$s { get; set; }$end$
]]></Code>
</Snippet>
</CodeSnippet>
it is generating this: public DbSet<Game> Games { get; set; }
in this part I adding namespace for this snippet.
<Imports>
<Import>
<Namespace>EDGE.Domain</Nam开发者_Go百科espace>
</Import>
</Imports>
I believe that the namespace should be automatically added when I use this snippet, but it did not.
I can not find the descriptions for each attribute of .snippet file(is there any reference documentation of all supported attributes and their meaning?). Can anyone tell me what is tag for?
From MSDN:
Namespace Element - Specifies the namespace that must be imported for the code snippet to compile and run.
Check it out - all snippet schema tags and their attributes are described there.
精彩评论