"'System.IO.FileSystemInfo.FullPath' is inaccessible due to its protection level" error in C#
<p>I have a C# programme like as follows. But it fails. 
Error is 'System.IO.FileSystemInfo.FullPath' is inaccessible due to its protection level.
And FullPath underlined in blue.     </p>

<pre><code>protected void Main(string[] args)
{
    DirectoryInfo parent = new DirectoryInfo(@"C:\Users\dell\Desktop\rename");
    foreach (DirectoryInfo child in parent.GetDirectories())
    {
        string newName = child.FullPath.Replace('_', '-');

        if (newName != child.FullPath)
        {
            child.MoveTo(newName);
        }
    }
}
</code></pre>
