Skip to content

Conversation

GangWang01
Copy link
Member

Fixes #9052

Context

For RoslynCodeTaskFactory, dotnet path is wrongly set using the path of the application when running the application via application.exe.

Changes Made

Get dotnet path through the following in order.

  1. Honor the environment variable DOTNET_HOST_PATH for tools and MSBuild tasks within the SDK to ensure a consistent experience.
  2. Fallback to get dotnet path from current process which might be dotnet executable.
  3. If the path resolved above is not dotnet executable, rely on dotnet via the system's PATH.

Testing

Add a test that verifies build the task of RoslynCodeTaskFactory using API.

Notes

@GangWang01 GangWang01 force-pushed the api-dotnetpath branch 3 times, most recently from 24f6f92 to 035d8ed Compare September 12, 2023 09:19
@GangWang01 GangWang01 marked this pull request as ready for review September 12, 2023 10:05
Copy link
Member

@rainersigwald rainersigwald left a comment

Choose a reason for hiding this comment

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

Just a couple of nits, but looks good!

@GangWang01
Copy link
Member Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@rainersigwald rainersigwald merged commit 6a27dad into dotnet:main Oct 26, 2023
@GangWang01 GangWang01 deleted the api-dotnetpath branch October 30, 2023 08:42
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.

API-using application is spawned instead of dotnet when using CodeTaskFactory

3 participants