Question: If the ? char is a specified char ?

Experts,
   I wrote a task and pass a parameter in. details as follows:

MSBuild file
------------------------------------
<ItemGroup>
   <MyItems Include="c:\common3. \*.*"></ADDL_LIB> 
   <MyItems Include="c:\nodes.600\*.*"></ADDL_LIB>
</ItemGroup>
<Target Name="MyTask1">
    <CopyMyTask 
    PARAMS=="@(MyItems)"/>
</Target>

   In my task, I can get the PARAMS parameter. However, MSBuild only pass a member (c:\nodes.600\*.*) to task and the count of PARAMS' member is 1. I don't know why the member (c:\common3. \*.*) is missed by MSBuild. Could anyone can help me

Thanks,
Hercules




Answer this question

Question: If the ? char is a specified char ?

  • Ram .Net Design Architect

    Hercules,

    The " " character, like the "*" character, is treated specially by MSBuild as a wildcard - it matches exactly one character.  This behavior is consistent with cmd.exe.  So examples that would match in this case:

    c:\common3.a\Class1.cs
    c:\common3.a\MyProject.csproj
    c:\common3.1\Class1.vb
    c:\common3.1\MyProject.vbproj

    etc.

    If MSBuild does not find a match, it will not add any items to the MyItems list.

    Does that help

    thanks,
    jeff
    tester on msbuild

  • curous_rosebud

    If you write %3f instead of then it should be treated as a literal character instead of a wildcard. 3f is the hex code for .

    Dan

  • Question: If the ? char is a specified char ?