Understanding MSBuild: Printing a variable value

Viewed 1432

I have following Import in a .csproj file. How can I find the value of Variable at this point of props?

<Import Project="<path_to_abc>\$(Variable)\abc.props>"
        Condition=" '$(Variable)' != '' "       
/>

I get build error:

can not find props files : <path_to_abc>\\abc.props

How can I see the value of Variable here? If I put Message in the .csproj file above Import, what Target dependency should I give?

<Target Name="PrintInfo" BeforeTargets="BeforeBuild">
   <Message Text="'$(Variable)' $(Variable.length) " />
</Target>

gives me '' 0.

But is that because of BeforeBuild?

How does MSBuild work? Does it process all properties before and in the first come first order? And then if it processes the Targets, does it print the value at the current time?

How can I see what values are put in while evaluating the props?

1 Answers
Related