Remove ResolverTargetFramework and ToolsetTargetFramework properties, use SdkTargetFramework directly#52743
Conversation
Co-authored-by: marcpopMSFT <12663534+marcpopMSFT@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR simplifies the build configuration by removing the redundant ResolverTargetFramework property, which was simply aliasing SdkTargetFramework. All project files now reference SdkTargetFramework directly.
Changes:
- Removed
ResolverTargetFrameworkproperty definition from Directory.Build.props - Updated 6 project files to use
$(SdkTargetFramework)instead of$(ResolverTargetFramework)for their TargetFrameworks property
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| Directory.Build.props | Removed the redundant ResolverTargetFramework property definition and its explanatory comment |
| src/Resolvers/Microsoft.NET.Sdk.WorkloadManifestReader/Microsoft.NET.Sdk.WorkloadManifestReader.csproj | Replaced $(ResolverTargetFramework) with $(SdkTargetFramework) in TargetFrameworks property |
| src/Resolvers/Microsoft.NET.Sdk.WorkloadMSBuildSdkResolver/Microsoft.NET.Sdk.WorkloadMSBuildSdkResolver.csproj | Replaced $(ResolverTargetFramework) with $(SdkTargetFramework) in TargetFrameworks property |
| src/Resolvers/Microsoft.DotNet.SdkResolver/Microsoft.DotNet.SdkResolver.csproj | Replaced two instances of $(ResolverTargetFramework) with $(SdkTargetFramework) in TargetFrameworks properties |
| src/Resolvers/Microsoft.DotNet.NativeWrapper/Microsoft.DotNet.NativeWrapper.csproj | Replaced $(ResolverTargetFramework) with $(SdkTargetFramework) in TargetFrameworks property |
| src/Microsoft.DotNet.TemplateLocator/Microsoft.DotNet.TemplateLocator.csproj | Replaced two instances of $(ResolverTargetFramework) with $(SdkTargetFramework) in TargetFrameworks properties |
| src/Cli/Microsoft.DotNet.Cli.Utils/Microsoft.DotNet.Cli.Utils.csproj | Replaced $(ResolverTargetFramework) with $(SdkTargetFramework) in TargetFrameworks property |
|
@ViktorHofer you looked through some of this during the the net11 update. Do you know if we still need a separate value for ToolsetTargetFramework either? I mostly removed this based on the comment in the file and my memory agreeing that we only had it for VSMac. |
|
Agreed, we shouldn't need any of these anymore. |
1 similar comment
|
Agreed, we shouldn't need any of these anymore. |
|
@copilot I believe ToolsetTargetFramework can be replaced by SdkTargetFramework as well. Can you confirm and make that change? |
Co-authored-by: marcpopMSFT <12663534+marcpopMSFT@users.noreply.github.com>
Confirmed and done. Replaced all references to |
...osoft.NET.Sdk.WorkloadMSBuildSdkResolver/Microsoft.NET.Sdk.WorkloadMSBuildSdkResolver.csproj
Outdated
Show resolved
Hide resolved
|
@marcpopMSFT I pushed two commits to also avoid the net472 hardcodes by using the NETFRAMEWORK preprocessor directive in code and the NetFrameworkToolCurrent property in msbuild. |
|
/backport to release/10.0.3xx |
|
Started backporting to |
|
@marcpopMSFT backporting to git am output$ git am --3way --empty=keep --ignore-whitespace --keep-non-patch changes.patch
Creating an empty commit: Initial plan
Applying: Replace ResolverTargetFramework with SdkTargetFramework
Using index info to reconstruct a base tree...
M Directory.Build.props
M src/Cli/Microsoft.DotNet.Cli.Utils/Microsoft.DotNet.Cli.Utils.csproj
Falling back to patching base and 3-way merge...
Auto-merging Directory.Build.props
CONFLICT (content): Merge conflict in Directory.Build.props
Auto-merging src/Cli/Microsoft.DotNet.Cli.Utils/Microsoft.DotNet.Cli.Utils.csproj
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
hint: When you have resolved this problem, run "git am --continue".
hint: If you prefer to skip this patch, run "git am --skip" instead.
hint: To restore the original branch and stop patching, run "git am --abort".
hint: Disable this message with "git config set advice.mergeConflict false"
Patch failed at 0002 Replace ResolverTargetFramework with SdkTargetFramework
Error: The process '/usr/bin/git' failed with exit code 128 |
…work, use SdkTargetFramework directly Co-authored-by: marcpopMSFT <12663534+marcpopMSFT@users.noreply.github.com>
Removes the
ResolverTargetFrameworkandToolsetTargetFrameworkproperties, which were simply aliasingSdkTargetFramework. All references now useSdkTargetFrameworkdirectly.Changes
ResolverTargetFrameworkandToolsetTargetFrameworkproperty definitions$(ResolverTargetFramework)with$(SdkTargetFramework):src/Resolvers/Microsoft.NET.Sdk.WorkloadMSBuildSdkResolver/*.csprojsrc/Resolvers/Microsoft.DotNet.SdkResolver/*.csprojsrc/Resolvers/Microsoft.NET.Sdk.WorkloadManifestReader/*.csprojsrc/Resolvers/Microsoft.DotNet.NativeWrapper/*.csprojsrc/Cli/Microsoft.DotNet.Cli.Utils/*.csprojsrc/Microsoft.DotNet.TemplateLocator/*.csproj$(ToolsetTargetFramework)with$(SdkTargetFramework):benchmarks/MicroBenchmark/*.csprojtest/directoryNo functional change - both properties resolved to the same value.
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.