MSBuildLocator icon indicating copy to clipboard operation
MSBuildLocator copied to clipboard

Mono support

Open rainersigwald opened this issue 6 years ago • 4 comments

Mono GACs the old xbuild assemblies but not the new MSBuild 15 ones, so applications running on Mono have the same load-the-right-MSBuild-assembly problems as on full framework, exacerbated since there's no Mono packages so a NuGet reference pulls a Windows-only full-framework assembly.

rainersigwald avatar Aug 15 '18 18:08 rainersigwald

This could be a starting point for "modern" MSBuild support in Mono, representing some work I did this afternoon. It's working nicely on macOS at least.

  • https://github.com/xamarin/mirepoix/blob/master/src/Xamarin.MSBuild.Tooling/MSBuildLocator.cs

I started with .NET Core support as well (really want to be able to run via dotnet xunit). Unfortunately I had to give up on that path due to lack of time/more pressing matters because after assemblies are loaded from the .NET Core SDK, the particular code I want to play with (ProjectCollection.LoadProject) crashes with StackOverflowException when loading a simple SDK style project with no [explicit] dependencies. No problems at all on Mono.

I'll continue to look into this over time and would be happy to adapt what I come up with into a PR here.

abock avatar Aug 16 '18 04:08 abock

We also do this OmniSharp here: https://github.com/OmniSharp/omnisharp-roslyn/blob/master/src/OmniSharp.Host/MSBuild/Discovery/Providers/MonoInstanceProvider.cs.

DustinCampbell avatar Aug 16 '18 13:08 DustinCampbell

@DustinCampbell Nice. OmniSharp is probably a more ideal starting place. How does it find MSBuild inside .NET Core SDKs? Not seeing anything obvious in the Providers directory.

abock avatar Aug 16 '18 15:08 abock

It doesn't. OmniSharp ships a small standalone set of MSBuild assemblies as a fallback.

DustinCampbell avatar Aug 23 '18 18:08 DustinCampbell

We're not adding support for mono.

Forgind avatar Mar 17 '23 22:03 Forgind