EDN Admin
Well-known member
Hi,
I am calling a method to read the configuration file and the method returns IEnumerable<XElement>, and i have set a breakpoint in the method. When i debug it does not hit the breakpoint.
public IEnumerable<XElement> ReadFile(string configFilePath)<br/>
{<br/>
using (var reader = XmlReader.Create(configFilePath))<br/>
{<br/>
while (reader.Read())<br/>
{<br/>
if (reader.NodeType == XmlNodeType.Element && reader.Name == "Name")<br/>
{<br/>
var e = XElement.ReadFrom(reader) as XElement;<br/>
yield return e;<br/>
<br/>
}<br/>
}<br/>
reader.Close();<br/>
}<br/>
}
and i call this method from a different class like
objReadAppConfigFile.ReadFile(SystemStrings.configFilePath); without mentioning any explicit return type.
Please tell me where i am going wrong <hr class="sig litu Here
View the full article
I am calling a method to read the configuration file and the method returns IEnumerable<XElement>, and i have set a breakpoint in the method. When i debug it does not hit the breakpoint.
public IEnumerable<XElement> ReadFile(string configFilePath)<br/>
{<br/>
using (var reader = XmlReader.Create(configFilePath))<br/>
{<br/>
while (reader.Read())<br/>
{<br/>
if (reader.NodeType == XmlNodeType.Element && reader.Name == "Name")<br/>
{<br/>
var e = XElement.ReadFrom(reader) as XElement;<br/>
yield return e;<br/>
<br/>
}<br/>
}<br/>
reader.Close();<br/>
}<br/>
}
and i call this method from a different class like
objReadAppConfigFile.ReadFile(SystemStrings.configFilePath); without mentioning any explicit return type.
Please tell me where i am going wrong <hr class="sig litu Here
View the full article