MSBuildSdks icon indicating copy to clipboard operation
MSBuildSdks copied to clipboard

can we show a warning when we have a packages.config and Packages.props

Open jmecosta opened this issue 5 years ago • 4 comments

@jeffkl is it possible to show a warning when a project has a packages.config and a packages.props is found at root of the project. it has a few times that builds have fail and takes me a while to figure out that a packages.config is still found in the project folder and breaks the all central package defintion

thanks

jmecosta avatar May 28 '20 18:05 jmecosta

Yes anything is possible. I'm not sure if this quite makes sense though as there are valid scenarios where you need packages.config. For example, Azure Service Fabric (.sfproj) and C++ (.vcxproj) only support packages.config.

Perhaps if we limited by file extension it would work well?

  • .csproj
  • .vbproj
  • .fsproj

Or do a whitelist of extensions that are allowed to have packages.config?

  • .sfproj
  • .vcxproj

I'm fine with either approach, seems like a great feature considering central package versioning is all about maintaining a healthy code base.

jeffkl avatar Jun 04 '20 15:06 jeffkl

What about a third approach and let users supress that with a parameter defined in the project or globally?

We have vcxproj and use nugets but we removed all packages.configs from the projects foldets and we use only central targets, similar approach as package.props but uglier 😅

On Thu, 4 Jun 2020, 18:48 Jeff Kluge, [email protected] wrote:

Yes anything is possible. I'm not sure if this quite makes sense though as there are valid scenarios where you need packages.config. For example, Azure Service Fabric (.sfproj) and C++ (.vcxproj) only support packages.config.

Perhaps if we limited by file extension it would work well?

  • .csproj
  • .vbproj
  • .fsproj

Or do a whitelist of extensions that are allowed to have packages.config?

  • .sfproj
  • .vcxproj

I'm fine with either approach, seems like a great feature considering central package versioning is all about maintaining a healthy code base.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/microsoft/MSBuildSdks/issues/182#issuecomment-638941595, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAH6HSBYT5IEQBWCE2MSMELRU665BANCNFSM4NNKVQYA .

jmecosta avatar Jun 04 '20 19:06 jmecosta

That could work too, you set a property to be told if you placed a packages.config next to a project that really should be using PackageReference and another property that just blindly logs a warning if it comes across a packages.config.

jeffkl avatar Jun 04 '20 19:06 jeffkl

Yep sounds good to me... thanks

On Thu, 4 Jun 2020, 22:52 Jeff Kluge, [email protected] wrote:

That could work too, you set a property to be told if you placed a packages.config next to a project that really should be using PackageReference and another property that just blindly logs a warning if it comes across a packages.config.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/microsoft/MSBuildSdks/issues/182#issuecomment-639080502, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAH6HSEHNU2OCNEVSIH7UOLRU73RBANCNFSM4NNKVQYA .

jmecosta avatar Jun 04 '20 19:06 jmecosta