Closed rainersigwald closed 1 year ago
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.
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.
We also do this OmniSharp here: https://github.com/OmniSharp/omnisharp-roslyn/blob/master/src/OmniSharp.Host/MSBuild/Discovery/Providers/MonoInstanceProvider.cs.
@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.
It doesn't. OmniSharp ships a small standalone set of MSBuild assemblies as a fallback.
We're not adding support for mono.
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.