Microsoft Developer Network > 포럼 홈 > MSBuild > Any change in the processing of Exists() between 2.0 and 3.5
질문하기질문하기
 

답변됨Any change in the processing of Exists() between 2.0 and 3.5

  • 2008년 7월 21일 월요일 오후 3:32GaelFraiteur 사용자 메달사용자 메달사용자 메달사용자 메달사용자 메달
     
    Consider an Exist function on an Import element, for instance:

    <Import Project="PostSharp-Samples-Src.targets" Condition="Exists('PostSharp-Samples-Src.targets')"/>


    Now suppose this Import is in a .targets file, i.e. it is imported for, say, a .csproj, that it in a different directory as the .targets file.

    In 2.0, the argument of the Exist method is resolved relatively to the directory of the .targets file, which is the only meaningful to process relative paths in .targets files. However, in 3.5, the same technique (and actually the same code) does not work.

    Can anyone give some explanation about this?

    Thanks,

    -Gael


    Gael Fraiteur -- postsharp.org

답변

  • 2008년 9월 22일 월요일 오후 3:02DanMoseley - MSFT중재자사용자 메달사용자 메달사용자 메달사용자 메달사용자 메달
     답변됨
    I believe we may have broken this in MSBuild 3.5, which is very embarrassing.
    All I can suggest is that you somehow use a full path.
    Dan -- MSBuild
    developer on msbuild

모든 응답

  • 2008년 9월 22일 월요일 오후 3:02DanMoseley - MSFT중재자사용자 메달사용자 메달사용자 메달사용자 메달사용자 메달
     답변됨
    I believe we may have broken this in MSBuild 3.5, which is very embarrassing.
    All I can suggest is that you somehow use a full path.
    Dan -- MSBuild
    developer on msbuild
  • 2008년 9월 23일 화요일 오후 9:11Chris Eargle 사용자 메달사용자 메달사용자 메달사용자 메달사용자 메달
     
    I verified that this behavior is different between 2.0 and 3.5. I would recommend removing the condition if the file will always be there (note that the import behavior didn't change). In many cases it is preferable to receive an error if the file failed to import.
    KodefuGuru.com - Life Student of the Kodefu Arts