I want to compare 2 web.config files by content, so that the difference is shown in terms of line number. I don't want to use Compare-Object as it compares line by line, which is not exactly the proper method for comparison.
Asked
Active
Viewed 543 times
3 Answers
0
Perhaps XmlDiff can help. It understands XML and generates a difference.

Richard Schneider
- 34,944
- 9
- 57
- 73
0
Have you considered to Serialize the config files? You can even generate classes with xsd.exe and use the objects in your program as you like.

Robert Schmidt
- 21
- 5
0
You are looking for compare two web.config it means you wants two xml files, so you have to think that
You can use Xdocument object, Initialize two diffrunt XDocument object and load both xml respectivly
ref this answer
-
How do I convert web.config files to XDocument objects? I have to generate an xml tree to use Deepequals right ? – Shelly Tomar Sep 14 '15 at 09:05
-
web config itself a xml file parse it ti xdocument, ref how to pass xml to xdocument and follow it – ITGenius Sep 14 '15 at 09:40
-
Thanks..It helped.. But how do I find the line number or the particular tag in which change is there ? – Shelly Tomar Sep 15 '15 at 06:57