tags:

views:

401

answers:

2

Hi,

I am using ReadLinesFromFile for reading multiple lines from a txt file and appending it to the path in sql.execute. The problem is its reading all the lines and appending them at once:

Text File Contents:

a.sql
b.sql

Sql.Execute ServerName="$(ServerName)" DatabaseName="CDRCntroller" path="..\DB\CDRController\BROKER\@(Prop1).

MSBuild is taking the path as : .....\BROKER\a.sql;b.sql

Any way I can use Prop1 as an array and refer the contents in the file one by one?

I tried using StringToItemList also but no luck :(

Thanks.

A: 

Use metadata notation instead. Like this :

Sql.Execute ServerName="$(ServerName)" DatabaseName="CDRCntroller" path="..\DB\CDRController\BROKER\%(Prop1.Identity)
madgnome
+2  A: 

You should try this

Sql.Execute ServerName="$(ServerName)" DatabaseName="CDRCntroller" path="..\DB\CDRController\BROKER\%(Prop1.Identity)

The % tells Msbuild to repeat the task for each item. Identity is a Metadata containing the item itself.

Hope it helps !

Cédric Rup