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

Support launching net taskhost - initial implementation #11393

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

YuliiaKovalova
Copy link
Member

@YuliiaKovalova YuliiaKovalova commented Feb 5, 2025

Partially Fixes #11331

To test the feature, setup these env variables:
MSBuildToolsDirectoryNET = e.g. "C:\msbuild\msbuild_yk\msbuild\artifacts\bin\bootstrap\core"
MSBuildAssemblyDirectory = e.g. "C:\msbuild\msbuild_yk\msbuild\artifacts\bin\bootstrap\core\sdk\9.0.200-preview.0.24603.3"

Keep in mind, due to current handshake mechanism, only matching version of sdk can be launched.

The tests are commented because we don't expect them to run now for NET runtime. There is a separate task to cover this functionality.

@YuliiaKovalova YuliiaKovalova force-pushed the dev/ykovalova/support_launching_net_taskhost branch from 2d1cd86 to 9b892e9 Compare February 5, 2025 13:56
@YuliiaKovalova
Copy link
Member Author

ExampleNetTask.zip

Copy link
Member

@baronfel baronfel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some general questions as I was idly looking at the work so far :) Happy to see this start!

{
// Start the new process. We pass in a node mode with a node number of 2, to indicate that we
// want to start up an MSBuild task host node.
commandLineArgs = $"/nologo /nodemode:2 /nodereuse:{ComponentHost.BuildParameters.EnableNodeReuse} /low:{ComponentHost.BuildParameters.LowPriority}";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the rest of these arguments (node reuse/priority) should be applied to the .NET-host command line too, right?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure
@rainersigwald could you clarify this point, please?

if (!string.IsNullOrWhiteSpace(realTaskAssemblyLoaction) &&
realTaskAssemblyLoaction != _taskFactoryWrapper.TaskFactoryLoadedType.Path)
// TODO ask why for net task host it returns false net472\MSBuild\Current\Bin\Microsoft.Build.dll instead of path to a custom task.
// Interestingly TaskInstance._taskType contains the correct path.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rainersigwald , it's a question for you when you will review :)

@YuliiaKovalova YuliiaKovalova changed the title [DRAFT] Support launching net taskhost Support launching net taskhost - initial implementation Feb 14, 2025
@YuliiaKovalova YuliiaKovalova marked this pull request as ready for review February 17, 2025 08:45
@YuliiaKovalova YuliiaKovalova force-pushed the dev/ykovalova/support_launching_net_taskhost branch from ad14fb9 to 65691df Compare February 17, 2025 08:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support launching .NET taskhost
2 participants