Bug 14295 - Project.Load incorrectly resets the FullFileName property
Summary: Project.Load incorrectly resets the FullFileName property
Status: RESOLVED FIXED
Alias: None
Product: Class Libraries
Classification: Mono
Component: Ms.Build ()
Version: master
Hardware: PC Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Lluis Sanchez
URL:
Depends on:
Blocks:
 
Reported: 2013-08-28 14:28 UTC by Lluis Sanchez
Modified: 2013-08-29 04:59 UTC (History)
1 user (show)

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

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 GitHub or Developer Community 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:
Status:
RESOLVED FIXED

Description Lluis Sanchez 2013-08-28 14:28:40 UTC
Project.Load(TextReader) clears the FullFileName property, so when the build engine tries to resolve references, it does it from the wrong path.

Example (by mhutch):

            var thisDir = Path.GetDirectoryName(typeof (Program).Assembly.Location); 
            var engine = new Engine();
            var p = new Project(engine);
            var projectFile = Path.GetFullPath(args[0]);
            p.FullFileName = projectFile;
            p.Load(File.OpenText(projectFile));
            Console.WriteLine(p.FullFileName == projectFile);
 
This prints true on MS.NET, false on Mono.

In addition to keep the value of FullFileName, Load should also call PushThisFileProperty to initialize the project location variables.
Comment 1 Lluis Sanchez 2013-08-29 04:59:42 UTC
Fixed in master.