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

XDocumentExtensions not accessible #110

Open
Jericho opened this issue Apr 29, 2019 · 0 comments
Open

XDocumentExtensions not accessible #110

Jericho opened this issue Apr 29, 2019 · 0 comments

Comments

@Jericho
Copy link
Member

Jericho commented Apr 29, 2019

Would you be open to making the extension methods public? I have the content of a csproj in a XDocument variable and I need to search for a few specific nodes. Being able to use extension methods such as GetFirstElementValue would be really helpful.

Unfortunately I cannot use ParseProjectFile, which is already public, mainly for two reasons:

  • I have the content of the project file as a string in memory as opposed to in a file on disk. This means that I can't pass a IFile to the ParseProjectFile method
  • I need a reference to the XDocument because I will need modify some of the elements. Therefore the CustomProjectParserResult returned by the ParseProjectFile method is not practical for me

Assuming you agree to make these methods accessible publicly, I will contribute an additional extension method to update the content of a given element:

public static bool SetFirstElementValue(this XDocument document, XName elementName, string newValue, string config = null, string platform = "AnyCPU")
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

No branches or pull requests

1 participant