Skip to content

Fix CI: target MyPortfolio.csproj explicitly for build and publish#3

Merged
marksmith1994 merged 3 commits into
masterfrom
claude/add-claude-documentation-MabfT
May 21, 2026
Merged

Fix CI: target MyPortfolio.csproj explicitly for build and publish#3
marksmith1994 merged 3 commits into
masterfrom
claude/add-claude-documentation-MabfT

Conversation

@marksmith1994

Copy link
Copy Markdown
Owner

Summary

  • Both dotnet build and dotnet publish now target MyPortfolio.csproj directly, so the test project is never pulled into the CI pipeline and can't cause package resolution failures
  • Test package versions pinned to the confirmed-stable set from the dotnet new xunit template (xunit 2.4.2, Microsoft.NET.Test.Sdk 17.8.0, Moq 4.18.4)

This fixes the build failure introduced when the MyPortfolio.Tests project was added to the solution — dotnet build was building the full solution and hitting unresolvable NuGet packages.


Generated by Claude Code

claude added 3 commits May 20, 2026 22:53
Both dotnet build and dotnet publish now target MyPortfolio.csproj
directly so the test project is never pulled into the CI pipeline.
Also pins test package versions to the confirmed-stable set used by
the dotnet new xunit template (xunit 2.4.2, SDK 17.8.0, Moq 4.18.4).

https://claude.ai/code/session_01Qj49iUs6QNA2MQcCVP5cFN
- Add explicit 'dotnet restore MyPortfolio.csproj' step so NuGet only
  restores the app project, never the test project
- Add --no-restore to build step and --no-build to publish step so
  neither can trigger a solution-level restore that picks up the test
  project (whose packages are incompatible with older CI runners)
- Remove Build.0 entries for MyPortfolio.Tests from the solution so
  'dotnet build' without arguments also skips the test project

https://claude.ai/code/session_01Qj49iUs6QNA2MQcCVP5cFN
The test project lives in a subdirectory of the repo root, so the SDK's
default **/*.cs wildcard was pulling all test source files into
MyPortfolio.csproj — causing 'Moq not found' / 'Fact not found' errors
when building the app project. Explicitly remove the test folder from
Compile, Content, EmbeddedResource, and None item groups.

https://claude.ai/code/session_01Qj49iUs6QNA2MQcCVP5cFN
@marksmith1994 marksmith1994 merged commit 38ff2b8 into master May 21, 2026
3 checks passed
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.

2 participants