So in Visual Studio 2017, I get the following warning in the auto-generated packages.config file:
The 'packages' element is not declared.
It is the same issue as here: The 'packages' element is not declared
And here: nuget 'packages' element is not declared warning
The consensus seems to be that this warning can be safely ignored. Moreover, some of the comments suggest that attempts at fixing this can cause other issues and/or be hard to maintain.
For example, one contributor said:
None of the answers will solve your problem permanently. If you go to the path of adding XSD (From Xml menu, select "Create schema"), you will end up having problems with the package manager as it will clean up your packages.config file when you add a new package.
However, the most recent contributor suggested simply changing <packages>
to <packages xmlns="urn:packages">
. Doing this makes the error go away and I saw no OBVIOUS problem (my experience here is very limited).
However, I don't want to risk causing Nuget problems over a warning that does not need to be addressed. On the other hand, every project created in VS, I'm guessing, will have this error by default, so an easy, safe, and easily maintainable fix would be good to have.
So my bottom line question is: what exactly does changing <packages>
to <packages xmlns="urn:packages">
in the packages.config file do, and are there any risks or downsides to doing this?