The Exec is not executing on the 1st call either.  I do need the
FlavorToBuild because this helps build the path to the config file.  I
included a print statement that is showing the items in the list - in the
section under the ERROR label (below).
You might be on to something with the problem being with the 2 batch
statements, but I am not sure how to fix it.  Any suggestions?

Thanks,


On Mon, May 3, 2010 at 3:43 PM, <[email protected]> wrote:

>  Hi Oscar,
>
>
>
> For some reason SectionsToEncrypt.Section is evaluating to an empty string
> on the second call to Exec.
>
>
>
> From the exec command, it looks like you have two batching statements:
> %(SectionsToEncrypt.Section) and %(ConfigurationToBuild.FlavorToBuild). But
> I’m guessing this target is maybe down the chain somewhere where
> FlavorToBuild is fixed rather than iterating for this single Exec command.
>
>
>
> Is the ItemGroup somehow dependent on the FlavorToBuild? Could you try
> adding another debug print to print out the actual list of item for each
> section?
>
>
>
> Also, did you try posting to the MSDN Forum:
> http://social.msdn.microsoft.com/Forums/en/tfsbuild/threads/? More sets of
> eyes is always good. Or StackOverflow for that matter:
> www.stackoverflow.com?
>
>
>
> -Ross
>
>
>
>
>
>
>
> *From:* [email protected] [mailto:[email protected]] *On
> Behalf Of *Oscar Bautista
> *Sent:* Monday, May 03, 2010 12:51 PM
> *To:* ozTFS
> *Subject:* Working with ItemGroup and EXEC Command
>
>
>
> I created the ItemGroup shown in the code snippet.  I need to iterate
> through this ItemGroup and run the EXEC command also shown in the code
> snippet.  I cannot seem to get it to work.  The code returns this (note, the
> Message is written 2 times (which is correct), but the EXEC Command is not
> running correctly (the value is not seen in the error message.  I also need
> the EXEC to execute twice or by however sections I define in the ItemGroup.
>
> ERROR:
> Encrypting WebServer appSettings section
> Encrypting WebServer connectionStrings section
> C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_regiis.exe -pef "" "
> \\gaw\UI" -prov "RSACustomProvider"
> Encrypting configuration section...
> The configuration section '' was not found.
>
>
> CODE SNIPPET:
> <ItemGroup>
>     <SectionsToEncrypt Include="Item">
>       <Section>appSettings</Section>
>     </SectionsToEncrypt>
>     <SectionsToEncrypt Include="Item">
>       <Section>connectionStrings</Section>
>     </SectionsToEncrypt>
>   </ItemGroup>
>
>   <Target Name="EncryptWebServerWebConfigSections">
>     <Message Text="Encrypting WebServer %(SectionsToEncrypt.Section)
> section" />
>
>     <Exec Command="$(AspNetRegIis) -pef
> &quot;%(SectionsToEncrypt.Section)&quot;
> &quot;$(DropLocation)\$(BuildNumber)\%(ConfigurationToBuild.FlavorToBuild)\$(AnythingPastFlavorToBuild)&quot;
> -prov &quot;$(WebSiteRSACustomProviderName)&quot;"/>
>   </Target>
>
> _______________________________________________
> oztfs mailing list
> [email protected]
> http://prdlxvm0001.codify.net/mailman/listinfo/oztfs
>
>
_______________________________________________
oztfs mailing list
[email protected]
http://prdlxvm0001.codify.net/mailman/listinfo/oztfs

Reply via email to