Skip to content

[release/9.0.1xx] Fix tasks not loading on .NET Framework (#8952)#8956

Merged
ViktorHofer merged 1 commit intorelease/9.0.1xxfrom
BackportFixTasksNotLoadingOnNetFx
Apr 17, 2025
Merged

[release/9.0.1xx] Fix tasks not loading on .NET Framework (#8952)#8956
ViktorHofer merged 1 commit intorelease/9.0.1xxfrom
BackportFixTasksNotLoadingOnNetFx

Conversation

@ViktorHofer
Copy link
Copy Markdown
Member

@ViktorHofer ViktorHofer commented Apr 17, 2025

Partial backport of #8952

/cc @marcpopMSFT

This fixes a regression due to a TFM mismatch in msbuild task dependencies that was merged 10 days ago . The regression hasn't shipped anywhere yet but affects upcoming releases: release/9.0.106 up to 9.0.300.

Customer Impact

  • Customer reported
  • Found internally

The msbuild task assemblies from the Microsoft.TemplateEngine.Authoring.Tasks package throw the following exception when loaded with desktop msbuild (i.e. in VS):

C:\Users\vihofer.nuget\packages\microsoft.templateengine.authoring.tasks\10.0.100-preview.4.25215.8\build\Microsoft.
TemplateEngine.Authoring.Tasks.targets(14,5): error MSB4018: The "LocalizeTemplates" task failed unexpectedly. [C:\temp
\templmsbuild\templmsbuild.csproj]
C:\Users\vihofer.nuget\packages\microsoft.templateengine.authoring.tasks\10.0.100-preview.4.25215.8\build\Microsoft.Te
mplateEngine.Authoring.Tasks.targets(14,5): error MSB4018: System.IO.FileNotFoundException->Microsoft.Build.Framework.B
uildException.GenericBuildTransferredException: Could not load file or assembly 'Microsoft.Extensions.Logging.Abstracti
ons, Version=9.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60' or one of its dependencies. The system cannot f
ind the file specified. [C:\temp\templmsbuild\templmsbuild.csproj]

Change the .NET Framework assemblies TFM from net481 to net472 so that the task project resolves the .NET Framework dependencies instead of the .NET Standard dependencies which have a different assembly version and need binding redirects.

Regression

  • Yes
  • No

Regressed with 7fa9bf9

Testing

Filed #8955 for comprehensive tests. Verified that the referenced assembly version now matches the deployed binaries assembly version for both msbuild task assemblies.

Risk

Medium - Changing the TFM of the .NETFramework assemblies in packages from net481 to net472.

@ViktorHofer ViktorHofer requested a review from a team as a code owner April 17, 2025 07:55
@ViktorHofer ViktorHofer added the servicing-consider The issue to be considered for servicing label Apr 17, 2025
Copy link
Copy Markdown
Member

@MiYanni MiYanni left a comment

Choose a reason for hiding this comment

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

Looks good, but something wrong with the version used in this branch according to the failing tests.

You must install or update .NET to run this application.

@ViktorHofer ViktorHofer force-pushed the BackportFixTasksNotLoadingOnNetFx branch from f210ff0 to 17e762d Compare April 17, 2025 19:54
@ViktorHofer ViktorHofer force-pushed the BackportFixTasksNotLoadingOnNetFx branch from 17e762d to e3139ec Compare April 17, 2025 20:03
@ViktorHofer ViktorHofer changed the title Fix tasks not loading on .NET Framework (#8952) [release/9.0.1xx] Fix tasks not loading on .NET Framework (#8952) Apr 17, 2025
@ViktorHofer ViktorHofer added servicing-approved The issue is approved for servicing and removed servicing-consider The issue to be considered for servicing labels Apr 17, 2025
@ViktorHofer ViktorHofer merged commit a0bc400 into release/9.0.1xx Apr 17, 2025
10 checks passed
@ViktorHofer ViktorHofer deleted the BackportFixTasksNotLoadingOnNetFx branch April 17, 2025 21:14
mmitche pushed a commit to dotnet/sdk that referenced this pull request Apr 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

servicing-approved The issue is approved for servicing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants