Skip to content

Add .NET Framework reference assemblies for Linux builds#55

Merged
Chris-Wolfgang merged 3 commits intomainfrom
copilot/update-pr-workflow-install-dotnet
Feb 14, 2026
Merged

Add .NET Framework reference assemblies for Linux builds#55
Chris-Wolfgang merged 3 commits intomainfrom
copilot/update-pr-workflow-install-dotnet

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Feb 14, 2026

Description

Ubuntu runners lack .NET Framework reference assemblies, causing MSB3644 errors when building net462/net472/net48/net481 targets.

Created Directory.Build.props that automatically imports Microsoft.NETFramework.ReferenceAssemblies (v1.0.3) for all .NET Framework projects:

<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" 
                  Version="1.0.3" 
                  PrivateAssets="All" 
                  Condition="('$(TargetFramework)' != '' AND $(TargetFramework.StartsWith('net4'))) OR 
                             ('$(TargetFrameworkVersion)' != '' AND $(TargetFrameworkVersion.StartsWith('v4'))" />

Handles both SDK-style and legacy csproj formats without requiring workflow or project file modifications.

Type of change

  • Bug fix

How Has This Been Tested?

  • Clean build with dotnet restore && dotnet build --configuration Release succeeds (0 errors, previously 8 MSB3644 errors)
  • All 58 unit tests pass across all target frameworks
  • Verified SDK-style projects (src/Wolfgang.Etl.Abstractions) and legacy projects (examples/Net4.8/*) both compile

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

Screenshots (if applicable)

N/A

Additional context

Using Directory.Build.props is the recommended MSBuild approach for cross-cutting package references. The PrivateAssets="All" attribute prevents the package from affecting consumers of the library.

Original prompt

Problem

The PR checks workflow is failing with the following error:

error MSB3644: The reference assemblies for .NETFramework,Version=v4.8 were not found. To resolve this, install the Developer Pack (SDK/Targeting Pack) for this framework version or retarget

Job URL: https://github.com/Chris-Wolfgang/ETL-Abstractions/actions/runs/22006743418/job/63597811293

The build is attempting to compile projects targeting .NET Framework 4.8 (net48, net462, net481) but the GitHub Actions runner doesn't have the .NET Framework reference assemblies installed.

Solution

Update the .github/workflows/pr.yaml workflow file to install the .NET Framework 4.8 reference assemblies before the build step.

Add a new step before the build that installs the reference assemblies. The step should:

  1. Download the .NET Framework reference assemblies (you can use the Microsoft.NETFramework.ReferenceAssemblies NuGet package approach or download reference assemblies)
  2. Install them to a location accessible by MSBuild
  3. Ensure this runs on ubuntu-latest runners

Here's the recommended approach using the NuGet package method:

- name: Install .NET Framework Reference Assemblies
  run: |
    # Install reference assemblies via NuGet package
    dotnet new classlib -n TempProj -f net48 -o /tmp/tempproj
    cd /tmp/tempproj
    dotnet add package Microsoft.NETFramework.ReferenceAssemblies --version 1.0.3
    dotnet restore

Or alternatively, configure the projects to automatically use the reference assemblies package by adding it to the Directory.Build.props or the project files.

The step should be added after the .NET SDK setup step and before the build/test steps in the workflow.

Make sure the solution works for all .NET Framework targets used in the repository (net462, net48, net481).

This pull request was created from Copilot chat.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

…rops

Co-authored-by: Chris-Wolfgang <210299580+Chris-Wolfgang@users.noreply.github.com>
Copilot AI changed the title [WIP] Update PR workflow to install .NET Framework 4.8 assemblies Add .NET Framework reference assemblies for Linux builds Feb 14, 2026
Copilot AI requested a review from Chris-Wolfgang February 14, 2026 02:00
@Chris-Wolfgang Chris-Wolfgang marked this pull request as ready for review February 14, 2026 02:31
Copilot AI review requested due to automatic review settings February 14, 2026 02:31
Copy link
Copy Markdown
Contributor

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 adds a Directory.Build.props file to resolve MSB3644 errors that occur when building .NET Framework targets (net462, net472, net48, net481) on Ubuntu runners. The solution automatically imports the Microsoft.NETFramework.ReferenceAssemblies NuGet package for all .NET Framework projects, providing the necessary reference assemblies that are not available by default on Linux platforms.

Changes:

  • Added Directory.Build.props at the repository root to automatically include .NET Framework reference assemblies for all .NET Framework target frameworks
  • Uses conditional package reference that applies to both SDK-style projects (using TargetFramework) and legacy projects (using TargetFrameworkVersion)
  • Configured with PrivateAssets="All" to prevent the package from affecting library consumers

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread Directory.Build.props Outdated
Comment thread Directory.Build.props Outdated
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@Chris-Wolfgang Chris-Wolfgang merged commit c30c7f6 into main Feb 14, 2026
3 of 4 checks passed
@Chris-Wolfgang Chris-Wolfgang deleted the copilot/update-pr-workflow-install-dotnet branch February 14, 2026 02:55
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.

3 participants