Bug 2563 - MD does not interpret $(SolutionDir)
Summary: MD does not interpret $(SolutionDir)
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: Visual Studio Compatibility ()
Version: Trunk
Hardware: PC Linux
: Low normal
Target Milestone: ---
Assignee: Bugzilla
Depends on:
Reported: 2011-12-19 05:24 UTC by knittl89+bugs
Modified: 2015-12-11 01:41 UTC (History)
5 users (show)

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 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 knittl89+bugs 2011-12-19 05:24:06 UTC
MonoDevelop does not interpret $(SolutionDir) variable in build path settings for projects.

Having `<OutputPath>$(SolutionDir)\bin</OutputPath>` in .csproj files, I expect the build to create its files in, well, $(SolutionDir)/bin. Instead, it happens that a directory called '$(SolutionDir)' (literally) is created inside the project folder.

Solution and project files were created with Visual Studio 2010.
Comment 1 Mikayla Hutchinson [MSFT] 2011-12-19 15:36:14 UTC
This should work if you enable experimental xbuild support.
Comment 2 Simon Cropp 2011-12-23 21:29:29 UTC
I can confirm this is a bug in 2.8.5 even after I enable XBuild
Comment 3 Mikayla Hutchinson [MSFT] 2012-04-25 11:38:32 UTC
Did you restart MD after enabling xbuild support?

That said, this is probably something we need the MD configuration editing UI to be aware of, even with xbuild.
Comment 4 Mikayla Hutchinson [MSFT] 2012-08-20 11:29:09 UTC
I implemented SolutionDir support in the xbuild builder processes, but we don't handle it in the UI yet.
Comment 5 Simon Cropp 2012-12-14 21:49:14 UTC
any progress on supporting this in the UI?
Comment 6 robin.neatherway 2014-03-02 14:25:55 UTC
Is there any progress on this bug? Unfortunately it causes problems for the F# binding because the Monodevelop project model does not have the correct reference resolution. These are then passed onto the F# binding which causes spurious errors to be reported.
Comment 7 Mikayla Hutchinson [MSFT] 2014-03-02 18:01:32 UTC
Support for SolutionDir was implemented for the MSBuild/xbuild engine, as noted in comment 4. The preferences UI may not handle it correctly, but it works fine in the build system. If you have problems with the F# addin, please report a specific bug against it.
Comment 8 robin.neatherway 2014-03-02 18:23:36 UTC
The F# addin is getting its list of references from Monodevelop. Please see:


In the left-hand pane there is the cosmetic issue that the reference is highlighted red and marked as not resolved, but we are actually trying to request the resolved references through the project model. If this is not supported, should we load the project file ourselves and run it through the msbuild API as in:


or is there a way of getting this from an addin?
Comment 9 Mikayla Hutchinson [MSFT] 2014-03-03 01:07:26 UTC
That's a very different issue from this. This issue is that the SolutionDir property was not available in the MSBuild engine.

The issue you're seeing is that references in the solution pad are resolved using the old reference resolution system (which predates the existence of MSBuild). It's difficult to fix since it essentially involves rewriting the reference resolution system to call into MSBuild. We have no ETA on a fix.

For project types that have been updated to use the MSBuild build engine this is largely cosmetic, since code completion and the build engine do use MSBuild correctly, it's only the solution pad that's wrong.
Comment 10 robin.neatherway 2014-03-03 06:32:04 UTC
Thanks for the explanation. I have opened an F# addin issue at https://github.com/fsharp/fsharpbinding/issues/349.

Could you please point me to where the C# code completion gets its references (through MSBuild) so that we can adjust the F# addin to behave the same way?
Comment 12 robin.neatherway 2014-03-03 17:06:05 UTC
Great, thanks.
Comment 13 Lluis Sanchez 2015-12-11 01:41:07 UTC
This will be fixed in XS 6.0.