Bug 18001 - Path.Combine broken in
Summary: Path.Combine broken in
Alias: None
Product: iOS
Classification: Xamarin
Component: General ()
Version: 7.0.7
Hardware: All Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
Depends on:
Reported: 2014-02-25 15:39 UTC by Marco Lancione
Modified: 2014-02-25 16:52 UTC (History)
3 users (show)

Is this bug a regression?: ---
Last known good build:

Path.Combine bug test project (4.66 KB, application/zip)
2014-02-25 15:39 UTC, Marco Lancione

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Marco Lancione 2014-02-25 15:39:30 UTC
Created attachment 6148 [details]
Path.Combine bug test project

System.IO.Path.Combine is broken in The behavior was fine in 7.0.6 and 7.0.7 Beta.

The following simple test fails:

      var Path1 = "/foo";
      var Path2 = "/bar.txt";
      var path = Path.Combine( Path1, Path2 );

      // Expected path is /foo/bar.txt
      System.Diagnostics.Debug.Assert( path.Equals( Path1 + Path2 ), "Path.Combine() failure" );

I have attached a repro project as well. It fails both in the simulator and on the device.

There have been recent changes to Path.cs in mono master that may be related to this issue:

Version Info:
Mono 3.2.6
Xamarin Studio: 4.2.3
Comment 1 Rolf Bjarne Kvinge [MSFT] 2014-02-25 16:02:01 UTC
I just tried this on Windows with .NET, and it fails there too.

Maybe the regression is somewhere else?
Comment 2 Rolf Bjarne Kvinge [MSFT] 2014-02-25 16:03:40 UTC
I also tried with,, 7.0.6 and 7.0.5, and they all fail too.
Comment 3 Sebastien Pouliot 2014-02-25 16:06:15 UTC
The most recent change to Path.Combine is only in master (not in 7.0.7). Previous ones are quite older.
Comment 4 Marco Lancione 2014-02-25 16:52:15 UTC
You are right. After reviewing MSDN documentation and testing previous Xamarin iOS versions this is in fact the intended behavior of Path.Combine. The second string must contain a relative path and not an absolute one.

Sorry for the false alarm.