When you execute the following macro that gets the file templates for classes, forms and text files in C# and VB.NET:
Sub Macro1() Dim objSolution2 As EnvDTE80.Solution2 objSolution2 = CType(DTE.Solution, EnvDTE80.Solution2) MsgBox(objSolution2.GetProjectItemTemplate("Class.zip","VisualBasic")) MsgBox(objSolution2.GetProjectItemTemplate("Form.zip", "VisualBasic")) MsgBox(objSolution2.GetProjectItemTemplate("Text.zip","VisualBasic")) MsgBox(objSolution2.GetProjectItemTemplate("Class.zip", "CSharp")) MsgBox(objSolution2.GetProjectItemTemplate("Form.zip", "CSharp")) MsgBox(objSolution2.GetProjectItemTemplate("Text.zip", "CSharp")) End Sub
It fails for the 6th case:
objSolution2.GetProjectItemTemplate("Text.zip", "CSharp")
I thought it was a bug but it happens that the symmetric beauty of the code is broken because the actual name for the C# case is “TextFile.zip”, not “Text.zip”:
objSolution2.GetProjectItemTemplate("TextFile.zip", "CSharp")
It seems that C#/VB.NET parity didn’t reach this point yet 😉