Quantcast
Channel: Visual Studio Integrate forum
Viewing all articles
Browse latest Browse all 4410

VS2015 -RC1: Why ProjectItem.FileCodeModel is NULL?

$
0
0

I have an Extension to Visual Studio 2015 that needs to Iterate through codeElements in a ProjectItem. I check to see if ProjectItem has a FileCodeModel as shown below. 

        If ProjectItem.FileCodeModel Is Nothing Then
          g_objTrace.LogTrace(String.Format("{0} does not have FileCodeModel to determine its members.", getProjectItemFileName(ProjectItem)))

        Else
          CodeElements = ProjectItem.FileCodeModel.CodeElements

          If CodeElements IsNot Nothing Then
            For Each CodeElement In CodeElements
              ' Load all the elements in the projectitem
              Call WalkCodeElements(parentNode, ProjectItem, CodeElement)
            Next
          End If
        End If

For a lot of Projects that I tested FileCodeModel is NOT Nothing but for some it is. For example, I downloaded Roslyn and for ALL projectItems FileCodeModel is ALWAYS nothing.

Any ideas?

Is there an another way to enumerate code elements  in VS 2015?




Viewing all articles
Browse latest Browse all 4410

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>