Skip to content

Add warning if packages.config is used#46

Merged
Sergio0694 merged 2 commits into
mainfrom
dev/package-config-warning
May 14, 2023
Merged

Add warning if packages.config is used#46
Sergio0694 merged 2 commits into
mainfrom
dev/package-config-warning

Conversation

@Sergio0694

Copy link
Copy Markdown
Owner

Closes #45

Description

This PR adds a warning if packages.config is used in consuming projects.

@Sergio0694 Sergio0694 added the enhancement New feature or request label Jan 16, 2023
@Sergio0694

Copy link
Copy Markdown
Owner Author

Hey @cremor, I'm having trouble setting up a local packages.config project to validate this. If you have time, could you try getting the package from the build artifacts here (you can find it here) and see if you correctly get the warning? Thank you! 🙂

@cremor

cremor commented Jan 16, 2023

Copy link
Copy Markdown

Not getting any warning in my sample project: ConsoleApp1.zip

But I think I added it correctly because after using the VS feature to convert packages.config to <PackageReference> the files are generated correctly.

@DreadLordMikey

Copy link
Copy Markdown

Is the implication here that consuming applications would be encouraged to migrate away from the use of a packages.config file and towards the use of <PackageReference/>s in their .csproj project files?

@Sergio0694

Copy link
Copy Markdown
Owner Author

Yes. Source generators just don't seem to work at all with packages.config, so I don't think they'd have much of a choice 😅
Other than, of course, not using PolySharp at all. But also, packages.config is just terrible, so not a great loss ahah

@DreadLordMikey

DreadLordMikey commented Jan 20, 2023

Copy link
Copy Markdown

Alrighty then! I'll annotate that on my unit test repo for future reference. :)

It's fine with me, since NuGet restore in Azure Devops pipelines seems to have a problem restoring packages from a Packages.config for project references anyway. So I'm with you.

@Sergio0694 Sergio0694 force-pushed the dev/package-config-warning branch 2 times, most recently from 663c24e to 971e368 Compare May 12, 2023 14:21
@Sergio0694 Sergio0694 force-pushed the dev/package-config-warning branch from 7228b48 to 210120c Compare May 14, 2023 20:36
@Sergio0694 Sergio0694 marked this pull request as ready for review May 14, 2023 20:36
@Sergio0694

Copy link
Copy Markdown
Owner Author

Hey @cremor, I've updated the .targets file with new logic to check for packages.config, it should work correctly now 😄

@Sergio0694 Sergio0694 merged commit 6e69340 into main May 14, 2023
@Sergio0694 Sergio0694 deleted the dev/package-config-warning branch May 14, 2023 20:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update readme and add warning for projects using packages.config

3 participants