-
Notifications
You must be signed in to change notification settings - Fork 691
Add conditional net48 targeting to FluentMigrator.Analyzers.Tests #2184
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
Conversation
…yzers.Tests - Update FluentMigrator.Analyzers.Tests.csproj to conditionally target net48 on Windows and net8.0 on Linux - Add NUnit3TestAdapter package reference for test discovery - Pattern now matches FluentMigrator.Tests.csproj for consistency - All Microsoft.CodeAnalysis packages support .NET Framework 4.8 Co-authored-by: jzabroski <[email protected]>
Added a step to clean artifacts before the build process.
|
@copilot @PhenX The build is failing. I asked Google Gemini why, and this was the answer: To use .NET Framework 4.8 (net48) with GitHub Actions on a windows-latest runner, which currently defaults to Windows Server 2025, you can define your workflow in a YAML file within the .github/workflows directory of your repository. name: .NET Framework 4.8 Build
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Setup MSBuild
uses: microsoft/[email protected]
- name: Restore NuGet packages
run: nuget restore YourSolution.sln
- name: Build project
run: msbuild YourSolution.sln /p:Configuration=Release /p:Platform="Any CPU" /t:Build /p:VisualStudioVersion=17.0Explanation:
By following this structure, you can successfully build your .NET Framework 4.8 projects using the windows-latest GitHub Actions runner. |
Could you share the specific error message from the failing build? The current CI workflow uses The FluentMigrator.Tests project uses the same conditional targeting pattern and should work with the same approach. If there's a specific error with the Analyzers.Tests project, I can investigate further once I see the error message. |
|
@copilot The build is failing on this error message: https://github.com/fluentmigrator/fluentmigrator/actions/runs/19543787130/job/55957118146?pr=2184#step:7:70
We think the issue is that windows-latest does not ship with the .NET Framework SDK required to build net48 TargetFramework. Hence the previous analysis by Google Gemini suggesting to add |
- Install .NET Framework 4.8 Developer Pack on windows-latest runners - Revert to combined restore/build/test step to let dotnet test handle framework-specific restore - This fixes NETSDK1005 error when building net48 target on Windows Server 2025 Co-authored-by: jzabroski <[email protected]>
Fixed in commit 615872d. The issue was that Windows Server 2025 (windows-latest) doesn't have the .NET Framework 4.8 Developer Pack installed by default, which is required for building net48 projects with .NET SDK 9. The CI workflow now:
This should resolve the NETSDK1005 error. |
The
FluentMigrator.Analyzers.Testsproject only targeted net8.0, whileFluentMigrator.Testsconditionally targets net48 on Windows and net8.0 on Linux. This created inconsistent backwards compatibility coverage.Changes
FluentMigrator.Analyzers.Tests.csproj:NUnit3TestAdapterpackage reference for test discoveryImplementation
The project now uses the same MSBuild conditional pattern as
FluentMigrator.Tests:The Microsoft.CodeAnalysis packages (v4.11.0) and testing packages (v1.1.2) support netstandard2.0 and net472+ respectively, ensuring compatibility with net48.
CI Workflow Fix
Fixed the NETSDK1005 error on Windows by installing the .NET Framework 4.8 Developer Pack before building. Windows Server 2025 (windows-latest) includes the .NET Framework 4.8.1 runtime but not the Developer Pack, which provides the necessary targeting pack and reference assemblies for building net48 projects with .NET SDK 9.
Original prompt
<issue_description>
fluentmigrator/test/FluentMigrator.Analyzers.Tests/FluentMigrator.Analyzers.Tests.csproj
Line 4 in dc07e1c
<agent_instructions>Determine if Fluent</agent_instructions>
Comments on the Issue (you are @copilot in this section)
@jzabroski @copilot try again nowOriginal 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.