Skip to content

Update comment on roslyn tasks #12045

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

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

Update comment on roslyn tasks #12045

wants to merge 2 commits into from

Conversation

jjonescz
Copy link
Member

Follow up on dotnet/dotnet#629.
cc @jaredpar

@Copilot Copilot AI review requested due to automatic review settings June 20, 2025 08:09
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR replaces hard-coded Roslyn targets paths with the new $(RoslynTasksAssembly) property for CopyRefAssembly, Csc, and Vbc tasks.

  • Swapped AssemblyFile="$(RoslynTargetsPath)\Microsoft.Build.Tasks.CodeAnalysis.dll" for AssemblyFile="$(RoslynTasksAssembly)"
  • Consolidated Roslyn task assembly references behind a single MSBuild property
Comments suppressed due to low confidence (2)

src/Tasks/Microsoft.Common.tasks:107

  • [nitpick] Update this comment to mention the $(RoslynTasksAssembly) property and remove references to RoslynTargetsPath to reflect the new usage.
  <!-- NOTE: Keep in sync with SDK: src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Sdk.targets -->

src/Tasks/Microsoft.Common.tasks:108

  • [nitpick] Consider adding a Condition="'$(RoslynTasksAssembly)' != ''" attribute to each <UsingTask> so the build fails more gracefully if the property isn't set.
  <UsingTask TaskName="Microsoft.CodeAnalysis.BuildTasks.CopyRefAssembly"           AssemblyFile="$(RoslynTasksAssembly)" />

@jjonescz jjonescz marked this pull request as draft June 20, 2025 14:03
<UsingTask TaskName="Microsoft.CodeAnalysis.BuildTasks.Vbc" AssemblyFile="$(RoslynTargetsPath)\Microsoft.Build.Tasks.CodeAnalysis.dll" />
<UsingTask TaskName="Microsoft.CodeAnalysis.BuildTasks.CopyRefAssembly" AssemblyFile="$(RoslynTasksAssembly)" />
<UsingTask TaskName="Microsoft.CodeAnalysis.BuildTasks.Csc" AssemblyFile="$(RoslynTasksAssembly)" />
<UsingTask TaskName="Microsoft.CodeAnalysis.BuildTasks.Vbc" AssemblyFile="$(RoslynTasksAssembly)" />
Copy link
Member

Choose a reason for hiding this comment

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

Had a chat about this on teams, think the right course here is likely update the comments as it doesn't seem to be relevant to modern projects.

@jjonescz jjonescz changed the title Use RoslynTasksAssembly Update comment on roslyn tasks Jun 23, 2025
@jjonescz jjonescz marked this pull request as ready for review June 23, 2025 08:54
@jjonescz jjonescz requested a review from jaredpar June 23, 2025 09:35
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.

2 participants