Skip to content

Change to report the name of attribute type instead of the index when… #11879

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 4 commits into
base: main
Choose a base branch
from

Conversation

huulinh99
Copy link

@huulinh99 huulinh99 commented May 22, 2025

Fixes #
Fix the issue #10007 the message not display the name of the attribute type whose definition it did not find

Context

When using the MSBuild with WriteCodeFragment in .csproj file, if the positional constructor parameters, use metadata names that resemble _Parameter1, _Parameter2 and the Attribute cannot found, the message display "Could not infer the type of parameter "#1" because the attribute type is unknown. The value will be treated as a string" instead of the name of the parameters"

Changes Made

Make the message display the name of the parameters instead of the index
Add a UnitTest for this case

Testing

Build a .csproj file with WriteCodeFragment and using an Attribute cannot found with the positional constructor parameters

Notes

@huulinh99 huulinh99 marked this pull request as ready for review May 23, 2025 08:47
Co-authored-by: Tomas Bartonek <[email protected]>
@MichalPavlik MichalPavlik requested a review from JanProvaznik May 27, 2025 14:04
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