How should I properly package a task to use task isolation? #9347
-
I know changes have been made to load tasks in isolated way by attempting to load each task into a custom However, what I've not been able to find so far is any sort of clear documentation or examples of what all I need to do when packaging a task assembly to make sure that I'm properly opting in to using it. The layout I'm currently using is: However, it's not clear to me if that is correct or even working. Looking at a binlog from a build where the task is being used, I see log entries like:
The log messages all say |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 3 replies
-
Can you take a look at this example documentation and see if that is the kind of content you expected to see for isolated task packaging? |
Beta Was this translation helpful? Give feedback.
-
You shouldn't have to do anything at the task level to get the
That's accurate but confusing: on .NET there's only ever one AppDomain (because |
Beta Was this translation helpful? Give feedback.
-
@baronfel There appears to be something off with the tutorial project. The tutorial states "The dependencies of your MSBuild task must be packaged inside the package; they cannot be expressed as normal package references." However, after creating the tutorial project and building it, I don't actually see the Microsoft.Extensions.DependencyInjection assembly in the package: That tutorial also seems to have some things other things that aren't relevant now. For example, it claims that |
Beta Was this translation helpful? Give feedback.
-
@rainersigwald Is the deps.json file required to get the isolation, or is it enough to have the dependencies next to the task assembly in the package?
Given that AppDomains aren't really a thing on .NET, I was wondering if that log message was instead reporting on which |
Beta Was this translation helpful? Give feedback.
-
If you did have native dependencies, for example if you were using LibGit2Sharp in your task, I assume at that point you'd put the entire |
Beta Was this translation helpful? Give feedback.
Not required unless you have native dependencies; if it's all .NET assemblies just having 'em next to your task assembly should be sufficient.