I'm trying to write a C# snippet with this content:
...
<References>
<Reference><Assembly>Microsoft.VisualBasic.dll</Assembly></Reference>
</References>
<Imports>
<Import><Namespace>Microsoft.VisualBasic</Namespace></Import>
<Import><Namespace>System.Text</Namespace></Import>
<Import><Namespace>System.Xml</Namespace></Import>
</Imports>
...
As explained in the MSDN docs, im following the good structure:
Create a New Snippet with Imports and References - MSDN
I made two versions of the snippet, one for VB.Net and the other for CSharp which only differs on the code language declaration and the the code block, the rest of the snippet is the same.
Well, the VB version works perfect, it adds the Imports
statements that I declared and the assembly reference, but the C# version does not add any using
statement neither the assembly reference tat I declared in the snippet.
Why? How to fix it?.
UPDATE
I found the same issue from other person in StackOverflow, which never has been resolved, the solutions given are are unproductive:
There's a way to create a code snippet with automatically create a using reference?