I have a collection of project files:
<ItemGroup> <ApplicationToDeploy Include="Frontend.WebSite.csproj;11.WebServices.csproj;22.WebServices.csproj"/> <ApplicationToDeploy Include="33.WebServices.csproj;44.WebServices.csproj;Workflow55Svc.csproj"/> </ItemGroup>
I am trying to get a collection of .config files for these projects:
<Target Name="111"> <PropertyGroup> <Cfgs>@(ApplicationToDeploy->'%(RootDir)%(Directory)*.config')</Cfgs> </PropertyGroup> <ItemGroup> <InputConfigs Include="$(Cfgs)" /> </ItemGroup> <Message Text="Cfgs: @(InputConfigs)"/> </Target>
Inside the Target block , everything works fine (I see a collection of Web.Configs, App.Configs, Log4net.Configs, etc.):
Cfgs: C:\Sources\WebServices\11\WebServices\11.WebServices\Web.config;C:\Sources\WebServices\22\WebServices\22.WebServices\web.log4net.config;C:\Sources\WebServices\33\WebServices\33.WebServices\web.environment.config
But I want to initialize this ItemGroup outside the Target block. Like this:
<PropertyGroup> <Cfgs>@(ApplicationToDeploy->'%(RootDir)%(Directory)*.config')</Cfgs> </PropertyGroup> <ItemGroup> <InputConfigs Include="$(Cfgs)" /> </ItemGroup> <Target Name="111"> <Message Text="Cfgs: @(InputConfigs)"/> </Target>
And when I do this outside the target block, I get the following:
Cfgs: C:\Sources\WebServices\11\WebServices\11.WebServices\*.config;C:\Sources\WebServices\22\WebServices\22.WebServices\*.config;C:\Sources\WebServices\33\WebServices\33.WebServices\*.config
I do not understand what's going on. Is it possible to get the same result outside the Target block?
source share