Search code examples
c#asp.netvisual-studio-2010msbuildyui

Accessing other XML value from YUIBuild file


I have integrated YUI MSBuild for minification process. In the Build xml file defined for YUI i want to access other property from a xml file.

I have the version number defined in a xml file located in the project

<add key="VersionNumber" value="1000"/>

Assuming i have the above key in a sample.xml how can i access it from MSBuild project file

can i do something like this

<ItemGroup>
    <Content Include="constants.xml"/>
</ItemGroup>

Message Text="The output file value @(VersionNumber)"/>  

any help will be aprpeciated


Solution

  • I found the solution for this and thought it will be helpful to post. I used the xml read and got it , i used http://msbuildtasks.tigris.org/

    sample code , but my code is different though

     <XmlRead 
      XPath="/add/@connectionString"
      XmlFileName="app.config">
        <Output TaskParameter="Value" PropertyName="MyConnectionString" />
    </XmlRead>
    <Message Text="MyConnectionString: $(MyConnectionString)"/>