Results 1 to 5 of 5

Thread: [XML] Reading Visual Studio Project file

Threaded View

  1. #2
    Karen Payne MVP kareninstructor's Avatar
    Join Date
    Jun 2008
    Location
    Oregon
    Posts
    6,714

    Re: [XML] Reading Visual Studio Project file

    Hope this helps.

    I tried the following in VS2008 reading a VS2010 project file

    Code:
    Imports <xmlns:alias="http://schemas.microsoft.com/developer/msbuild/2003">
    
    Public Class Form1
        Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
            Dim doc = XDocument.Load("DynamicClassXML.vbproj")
    
            Dim Query = (From P In doc...<alias:Project> _
                        Where P.@ToolsVersion = "4.0" _
                        Select P).FirstOrDefault
    
    
            Console.WriteLine("[{0}]", Query.ToString)
        End Sub
    End Class
    which returned everything. Then I tried for a smaller chunk

    Code:
    Imports <xmlns:alias="http://schemas.microsoft.com/developer/msbuild/2003">
    
    Public Class Form1
        Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
            Dim doc = XDocument.Load("DynamicClassXML.vbproj")
    
            Dim Query = (From P In doc...<alias:Project> _
                        Where P.@ToolsVersion = "4.0" From X In P.<alias:PropertyGroup> _
                                                      Where X.<alias:AssemblyName>.Value = "VB 10 Generic Iterator Sample" _
                        Select X).FirstOrDefault
    
    
            Console.WriteLine("[{0}]", Query.ToString)
        End Sub
    End Class
    Last edited by kareninstructor; Jul 9th, 2011 at 10:15 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width