Skip to content
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

MSTest.Sdk: do not use IsImplictlyDefined #2880

Merged
merged 1 commit into from
May 21, 2024

Conversation

Evangelink
Copy link
Member

Do not use the IsImplictlyDefined="true" attribute in the PackageReference element in the .targets files. Instead,
rely on the VersionOverride attribute to define the package version. This is because for big projects, teams are usually
slowly migrating to MSTest.Sdk so they need to keep defining MSTest (and platform) packages in their CPM file.

If we use 'IsImplicitlyDefined' attribute, the package will be "defined twice" which will lead to NU1009 warnings that
are most of the time updated as errors (warnAsError). We created a thread with MSBuild and NuGet teams and the only suggested
solution is for users to suppress the warning which is not ideal. Until a better solution is provided, we will use the
VersionOverride trick instead as it achieves a relatively close behavior while preventing the warning.

We could also consider having a property like MSTestSdkDisableIsImplicitlyDefinedAttribute that users can set to true to
disable the IsImplicitlyDefined attribute in the .targets files but we don't see any strong reason to do that at the moment.

@Evangelink Evangelink merged commit b7bf1d0 into microsoft:main May 21, 2024
7 of 8 checks passed
@Evangelink Evangelink deleted the fix-sdk-cpm branch May 21, 2024 13:25
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