runtime - C# get project references that are projects - Stack Overflow

PHOTO EMBED

Mon Feb 27 2023 04:13:49 GMT+0000 (Coordinated Universal Time)

Saved by @javicinhio #cs

Private Sub GetProjectReferences()
    Dim lines = New List(Of String)
    Dim path = "..\..\TestApp.vbproj"
    For Each line In File.ReadAllLines(path)
        If line.Contains("<ProjectReference") Then
            Dim projNameWithExtension = line.Substring(line.LastIndexOf("\") + 1)
            Dim projName = projNameWithExtension.Substring(0, projNameWithExtension.IndexOf(".vbproj"))
            lines.Add(projName)
        End If
    Next
End Sub
content_copyCOPY

https://stackoverflow.com/questions/56055553/c-sharp-get-project-references-that-are-projects