Msbuild: Enable in-line tasks in xplat

Created on 20 Oct 2015  路  8Comments  路  Source: dotnet/msbuild

This feature was disabled as support for our current implementation is missing in .NET Core. This feature should be enabled.

.NET Core distant-future

Most helpful comment

All 8 comments

Just making a note: everyone involved with this has been making some level of assumption that the fix will involve using Roslyn for compilation. If an eventual solution is created that _doesn't_ do that, we should revisit other issues that are now marked as duplicates.

@jeffkl awesome. any chance this could be integrated into msbuild itself? (or maybe roslyn where the compiler targets come from)
So that RoslynCodeTaskFactory could be a replacement for / phase out the traditional CodeTaskFactory.

I had it working in Roslyn here: https://github.com/jeffkl/roslyn/commit/0996471fcebe2d08b9ba749f4eab67ca4bec3e3e

There were two problems that the MSBuild and Roslyn team couldn't agree upon.

  1. In order for full framework MSBuild.exe to run the .NET Standard tasks, it would need to have the full closure of facade assemblies. Right now full framework MSBuild only ships with the 3 facades that it needs. The MSBuild team didn't want to ship more than they had to.
  2. The code task factory needs to have reference assemblies to pass to the compiler. The Rolsyn team wanted MSBuild to ship them, but we felt that since the code task factory is the only thing that needed them that they should come with Roslyn.

So I just shipped my own package for now...

Thanks for the explanation!

Some thoughts:
ad 1.: If I understand it correctly, this should be irrelevant if run on .NET 4.7.1 since that has all the necessary assemblies inbox. And if I want all the latest and greatest features, I should use the latest versions of everything.
ad 2.: Well.. 馃挬 I raised a similar concern at https://github.com/dotnet/cli/issues/7689 (Being able to directly invoke csc doesn't make any sense if there aren't any ref assemblies). Maybe just adding a netstandard.dll ref assembly and msbuild assemblies could be enough.. (or just directly use the platform-specific netstandard.dll of the current runtime?)

I really do appreciate your RoslynCodeTaskFactory, I just hope that at some point it may be available without the need for a nuget package - e.g. for build "projects" that aren't projects but just msbuild scripts that don't have nuget integration.

Once MSBuild and Roslyn both target netstandard2.0 and there's a single reference assembly, then I'll resume talks with the Roslyn team to ship this with the compiler's build task assembly.

@jeffkl, is there any issue tracking for in Roslyn / MSBuild in the open? It's quite hard to find the in-progress tasks in the closed issue perhaps reopen this one? Found some related discussion by @terrajobst here: https://github.com/dotnet/roslyn/issues/16211 (another closed issue)

No, I discussed the work with the Roslyn team in person and have not opened an issue.

Was this page helpful?
0 / 5 - 0 ratings