Repository navigation
Explain unresolved C# @alternateType mappings - #12620
Draft
Jorge Rangel (jorgerangel-msft) wants to merge 2 commits into
Draft
Jorge Rangel (jorgerangel-msft) wants to merge 2 commits into
Jorge Rangel (jorgerangel-msft) wants to merge 2 commits into
Conversation
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
commit: |
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues remain in the changes clarifying C# dependency warnings and updating related diagnostic tests.
No open issues 🎉
What changed in this PR
Improves the C# generator’s unresolved @alternateType warnings to explain the NuGet dependency requirements behind issue #12616. The warning code and type-resolution behavior remain unchanged.
Changes:
- Adds guidance on package IDs, versioned
PackageReferenceentries, and centrally managed versions. - Clarifies missing-assembly diagnostics and normalizes warning punctuation.
- Adds ProjectReference diagnostic tests and updates existing message assertions.
| File | Description |
|---|---|
packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Utilities/ExternalTypeReferenceResolverTests.cs |
Tests actionable warnings for ProjectReference-only dependencies and updates expected messages. |
packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Utilities/ExternalTypeReferenceResolver.cs |
Adds shared package-reference guidance and clearer missing-assembly details. |
packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/TypeFactory.cs |
Explains missing package metadata and ensures consistent final punctuation. |
Review effort: Balanced
Contributor
|
No changes needing a change description found. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The C# generator’s warning didn’t explain why an
@alternateTypetarget available only through aProjectReferencecould not be resolved. The generator needs a versioned NuGet package reference for that lookup.@alternateType.ProjectReferencealone is insufficient and points to a versionedPackageReferenceor a central package version override.The
unsupported-external-typewarning code and resolution behavior are unchanged.