Skip to content

Fix: include OpenCvSharp.Analyzers.dll in NuGet package (analyzers/dotnet/cs/)#1882

Merged
shimat merged 1 commit into
mainfrom
claude/fervent-zhukovsky-af3487
May 27, 2026
Merged

Fix: include OpenCvSharp.Analyzers.dll in NuGet package (analyzers/dotnet/cs/)#1882
shimat merged 1 commit into
mainfrom
claude/fervent-zhukovsky-af3487

Conversation

@shimat
Copy link
Copy Markdown
Owner

@shimat shimat commented May 26, 2026

Summary

  • ProjectReference with OutputItemType="Analyzer" enables the Roslyn analyzers during in-solution builds, but does not cause the DLL to appear in the NuGet package under analyzers/dotnet/cs/
  • As a result, consumers of the OpenCvSharp4 NuGet package never saw the OCVS001–OCVS005 warnings (e.g. mat.Row(1).At<byte>(1))
  • Fix: add an explicit None item with Pack="true" and PackagePath="analyzers/dotnet/cs" pointing at the built OpenCvSharp.Analyzers.dll

What changed

src/OpenCvSharp/OpenCvSharp.csproj — added:

<None Include="..\OpenCvSharp.Analyzers\bin\$(Configuration)\netstandard2.0\OpenCvSharp.Analyzers.dll"
      Pack="true"
      PackagePath="analyzers/dotnet/cs"
      Visible="false" />

Verification

Ran dotnet pack before and after:

  • Before: analyzers/dotnet/cs/ absent from .nupkg
  • After: analyzers/dotnet/cs/OpenCvSharp.Analyzers.dll present in .nupkg

Reviewer notes

The None item references the build output path, so OpenCvSharp.Analyzers must be built before packing OpenCvSharp. This ordering is already guaranteed in normal solution builds and CI (the ProjectReference dependency ensures the analyzer project builds first).

Summary by CodeRabbit

  • Chores
    • Improved NuGet package configuration to ensure analyzers are properly included in the distributed package.

Review Change Stack

…rs/dotnet/cs/

OutputItemType="Analyzer" on a ProjectReference enables the analyzer during
in-solution builds but does not cause the DLL to be packaged into the NuGet
package. Add an explicit None item with Pack=true and PackagePath=analyzers/dotnet/cs
so that the Roslyn analyzers (OCVS001–OCVS005) are active for consumers of the
OpenCvSharp4 NuGet package.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
@shimat shimat self-assigned this May 26, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 26, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 758ab26d-ed49-4408-b74a-b520ecd2e94c

📥 Commits

Reviewing files that changed from the base of the PR and between d453d25 and 70adeaa.

📒 Files selected for processing (1)
  • src/OpenCvSharp/OpenCvSharp.csproj

📝 Walkthrough

Walkthrough

The project file is updated to explicitly configure NuGet packaging of the Roslyn analyzer DLL. A <None> item is added to include the built OpenCvSharp.Analyzers.dll in the analyzers/dotnet/cs directory with visibility disabled, ensuring the analyzer is correctly distributed within the NuGet package.

Changes

Analyzer Distribution

Layer / File(s) Summary
Analyzer DLL packaging configuration
src/OpenCvSharp/OpenCvSharp.csproj
A <None> item is added to pack OpenCvSharp.Analyzers.dll into analyzers/dotnet/cs (netstandard2.0) with Visible="false", and the surrounding XML comments describing analyzer packaging are updated.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically describes the main change: adding OpenCvSharp.Analyzers.dll to the NuGet package in the analyzers/dotnet/cs/ directory, which is precisely what the changeset accomplishes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/fervent-zhukovsky-af3487

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@shimat shimat merged commit 9ede960 into main May 27, 2026
10 checks passed
@shimat shimat deleted the claude/fervent-zhukovsky-af3487 branch May 27, 2026 00:40
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.

1 participant