Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MSBuild Core support for Tasks with native dependencies #1887

Closed
AArnott opened this issue Mar 19, 2017 · 3 comments
Closed

MSBuild Core support for Tasks with native dependencies #1887

AArnott opened this issue Mar 19, 2017 · 3 comments
Labels
Area: Engine Issues impacting the core execution of targets and tasks. .NET Core triaged
Milestone

Comments

@AArnott
Copy link
Contributor

AArnott commented Mar 19, 2017

I'm trying to fix dotnet/Nerdbank.GitVersioning#112 where my MSBuild Core Task needs to load the libgit2 native library and realizing that while .NET Core exposes an event handler to allow aided assembly resolution, it has no equivalent for native modules. And in particular MSBuild does not offer any support for this to Tasks either, so I'm sunk -- unless I perhaps create my own AssemblyLoadContext and use that, but that requires that my MSBuild Task invoke yet another dedicated assembly.

@AndyGerlicher
Copy link
Contributor

@AArnott can you add some more detail to your ask? Not sure how AssemblyLoadContext would help with native assemblies? And is this something you're looking at getting from MSBuild or CoreCLR?

@AArnott
Copy link
Contributor Author

AArnott commented Mar 21, 2017

AssemblyLoadContext lets me assist the CoreCLR with loading native modules as well. I worked around MSBuild Core's lack of offering this to MSBuild Tasks by hosting my own. And I'm thinking of wrapping this up in a reusable NuGet package as a crutch till #1756 is delivered.

No, I'd really rather CoreCLR never had offered an event on AssemblyLoadContext for loading assemblies so I wouldn't ask that they add another event for native module loading. But MSBuild should have a way to allow tasks to do this. And if this issue is resolved by #1754 such that all Tasks have their own load context and have access to influence that context, then we're good. :)

@rainersigwald
Copy link
Member

The .NET Core design for this is AssemblyDependencyResolver, which we plan to adopt for tasks in the .NET 5 timeframe (as part of #5037).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Engine Issues impacting the core execution of targets and tasks. .NET Core triaged
Projects
None yet
Development

No branches or pull requests

5 participants