![]() |
||||
|
Introduction When you iterate the code elements of a project code model using EnvDTE.Project.CodeModel.CodeElements, the attributes in the AssemblyInfo are not retrieved. This happens with C# projects in all Visual Studio versions and with VB.NET projects in Visual Studio .NET 2002/2003. It works fine with VB.NET projects in Visual Studio 2005 and higher. More Information Steps to reproduce the problem:
Sub GetCodeElements()
GetCodeElements(DTE.Solution.Projects.Item(1).CodeModel.CodeElements)
End Sub
Sub GetCodeElements(ByVal codeElements As CodeElements)
For Each codeElement As CodeElement In codeElements
Select codeElement.Kind
Case vsCMElement.vsCMElementNamespace
GetCodeElements(CType(codeElement, CodeNamespace).Members)
Case vsCMElement.vsCMElementAttribute
MessageBox.Show(codeElement.FullName)
End Select
Next
End Sub
As a workaround, you can locate the AssemblyInfo file and use its EnvDTE.ProjectItem.FileCodeModel. Related articles Go back to the 'Resources for Visual Studio .NET extensibility' section for more articles like this
You can code, design, locate code and document your apps much faster using VB.NET, C#, C++ or Visual J#:
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||