Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MSbuild, How to access project property value in Inline Task code?

I have inline Task code written in csharp

I wonder if there is anyway to access propect property in inline Task code

For ex. I am trying to replace string match with project property value. is it possible?

<![CDATA[
      MatchCollection matches = Regex.Matches(SourceStr, Pattern);

      for (int i = 0; i < matches.Count; i++)
           // replace the match value with project property... possible?


    ]]>
like image 728
in His Steps Avatar asked Jan 31 '13 23:01

in His Steps


1 Answers

Pass it as a parameter, like you would with a compiled task?

<ParameterGroup>
    <Foo ParameterType="System.Bar" Required="true" />
<ParameterGroup>

Edit: Looks like simple inline tokens work too.

<![CDATA[
    Console.WriteLine("$(Foo)");
]]>
like image 157
Ilya Kozhevnikov Avatar answered Sep 21 '22 19:09

Ilya Kozhevnikov