Package references not found
xp-development opened this issue · 5 comments
xp-development commented
No package references were found in my csproj files. I debug the code and found two parts that I have to change.
- To read XML elements it is necessary to add the namespace:
var ns = "http://schemas.microsoft.com/developer/msbuild/2003";
var packageReferences = xml.Root.Elements(XName.Get("ItemGroup", ns)).Elements(XName.Get("PackageReference", ns));
- Version is not an attribute. It is an element in my project files.
var version = reference.Element(XName.Get("Version", ns));
olsh commented
Hi @xp-development ,
Thank you for the info 👍
Could you please provide a demo solution?
xp-development commented
olsh commented
Thanks, I'll take a look. 👍
olsh commented
The package reference format was added in the 1.1.0 version.
Feel free to reopen the issue if you still have problems with the solution.
xp-development commented
The new package works. Thank you!!