Any change in the processing of Exists() between 2.0 and 3.5 Consider an Exist function on an Import element, for instance:<br><br><font color="#0000ff" size=2><font color="#0000ff" size=2> <p>&lt;</font></font><font color="#a31515" size=2><font color="#a31515" size=2>Import</font></font><font color="#0000ff" size=2> </font><font color="#ff0000" size=2><font color="#ff0000" size=2>Project</font></font><font color="#0000ff" size=2><font color="#0000ff" size=2>=</font></font><font size=2>&quot;</font><font color="#0000ff" size=2><font color="#0000ff" size=2>PostSharp-Samples-Src.targets</font></font><font size=2>&quot;</font><font color="#0000ff" size=2> </font><font color="#ff0000" size=2><font color="#ff0000" size=2>Condition</font></font><font color="#0000ff" size=2><font color="#0000ff" size=2>=</font></font><font size=2>&quot;</font><font color="#0000ff" size=2><font color="#0000ff" size=2>Exists('PostSharp-Samples-Src.targets')</font></font><font size=2>&quot;</font><font color="#0000ff" size=2><font color="#0000ff" size=2>/&gt;<br><br><br><font color="#000000">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. <br><br>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.<br><br>Can anyone give some explanation about this?<br><br>Thanks,<br><br>-Gael</font></p></font></font><hr size="1" align="left" width="25%">Gael Fraiteur -- postsharp.org© 2009 Microsoft Corporation. All rights reserved.Mon, 27 Jul 2009 21:53:17 Z4c2c885b-f64c-4fba-875c-15ef219e7d68http://social.msdn.microsoft.com/Forums/en-US/msbuild/thread/4c2c885b-f64c-4fba-875c-15ef219e7d68#4c2c885b-f64c-4fba-875c-15ef219e7d68http://social.msdn.microsoft.com/Forums/en-US/msbuild/thread/4c2c885b-f64c-4fba-875c-15ef219e7d68#4c2c885b-f64c-4fba-875c-15ef219e7d68GaelFraiteurhttp://social.msdn.microsoft.com/Profile/en-US/?user=GaelFraiteurAny change in the processing of Exists() between 2.0 and 3.5 Consider an Exist function on an Import element, for instance:<br><br><font color="#0000ff" size=2><font color="#0000ff" size=2> <p>&lt;</font></font><font color="#a31515" size=2><font color="#a31515" size=2>Import</font></font><font color="#0000ff" size=2> </font><font color="#ff0000" size=2><font color="#ff0000" size=2>Project</font></font><font color="#0000ff" size=2><font color="#0000ff" size=2>=</font></font><font size=2>&quot;</font><font color="#0000ff" size=2><font color="#0000ff" size=2>PostSharp-Samples-Src.targets</font></font><font size=2>&quot;</font><font color="#0000ff" size=2> </font><font color="#ff0000" size=2><font color="#ff0000" size=2>Condition</font></font><font color="#0000ff" size=2><font color="#0000ff" size=2>=</font></font><font size=2>&quot;</font><font color="#0000ff" size=2><font color="#0000ff" size=2>Exists('PostSharp-Samples-Src.targets')</font></font><font size=2>&quot;</font><font color="#0000ff" size=2><font color="#0000ff" size=2>/&gt;<br><br><br><font color="#000000">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. <br><br>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.<br><br>Can anyone give some explanation about this?<br><br>Thanks,<br><br>-Gael</font></p></font></font><hr size="1" align="left" width="25%">Gael Fraiteur -- postsharp.orgMon, 21 Jul 2008 15:32:32 Z2008-07-21T15:32:32Zhttp://social.msdn.microsoft.com/Forums/en-US/msbuild/thread/4c2c885b-f64c-4fba-875c-15ef219e7d68#036872f1-d6d0-4ba8-9a9d-1eb83ba5edachttp://social.msdn.microsoft.com/Forums/en-US/msbuild/thread/4c2c885b-f64c-4fba-875c-15ef219e7d68#036872f1-d6d0-4ba8-9a9d-1eb83ba5edacDanMoseley - MSFThttp://social.msdn.microsoft.com/Profile/en-US/?user=DanMoseley%20-%20MSFTAny change in the processing of Exists() between 2.0 and 3.5 I believe we may have broken this in MSBuild 3.5, which is very embarrassing.<br>All I can suggest is that you somehow use a full path.<br>Dan -- MSBuild<hr size="1" align="left" width="25%">developer on msbuildMon, 22 Sep 2008 15:02:06 Z2008-09-22T15:02:06Zhttp://social.msdn.microsoft.com/Forums/en-US/msbuild/thread/4c2c885b-f64c-4fba-875c-15ef219e7d68#17c90af3-897e-4ede-8d21-8352a8a109c8http://social.msdn.microsoft.com/Forums/en-US/msbuild/thread/4c2c885b-f64c-4fba-875c-15ef219e7d68#17c90af3-897e-4ede-8d21-8352a8a109c8Chris Earglehttp://social.msdn.microsoft.com/Profile/en-US/?user=Chris%20EargleAny change in the processing of Exists() between 2.0 and 3.5 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.<hr size="1" align="left" width="25%">KodefuGuru.com - Life Student of the Kodefu ArtsTue, 23 Sep 2008 21:11:49 Z2008-09-23T21:11:49Z