Skip to content

Fix GitHub Actions build issue by targeting only .NET 9 #1328

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: master
Choose a base branch
from

Conversation

Jim8y
Copy link
Contributor

@Jim8y Jim8y commented May 30, 2025

Problem

The GitHub Actions workflow was failing with a package downgrade error:

error NU1605: Warning As Error: Detected package downgrade: Neo from 3.8.1 to 3.8.1-CI01961

Root Cause

The workflow was attempting to build Neo.SmartContract.Testing for both netstandard2.1 and net9.0, but the project file only targets net9.0. This created a dependency resolution conflict when the workflow replaced the Neo project reference with a CI package reference.

Solution

  • Removed the netstandard2.1 target from the GitHub Actions build step
  • Now only builds for net9.0, which matches the project's target framework
  • Prevents the package downgrade warning that was being treated as an error

Changes

  • Modified .github/workflows/main.yml to only build Neo.SmartContract.Testing for net9.0
  • Aligns with the user preference to target only .NET 9 framework

Testing

  • Verified the build works locally with dotnet build ./src/Neo.SmartContract.Testing -f net9.0
  • No breaking changes to functionality

Fixes the CI build failure in the PublishPackage job.

- Remove netstandard2.1 target from Neo.SmartContract.Testing build step
- Prevents package downgrade error between Neo 3.8.1 and 3.8.1-CI01961
- Aligns with project's net9.0 target framework specification

Fixes the error:
error NU1605: Warning As Error: Detected package downgrade: Neo from 3.8.1 to 3.8.1-CI01961
@shargon
Copy link
Member

shargon commented May 30, 2025

But if we dont have the netstandard, package creation will fault

@shargon shargon requested a review from superboyiii June 1, 2025 20:56
@shargon
Copy link
Member

shargon commented Jun 1, 2025

I remember that this was a fix for publish, without this maybe we can't publish

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