Adding a folder when the folder already exists differs from C#


Select a folder, Project->New Folder, type in a folder name that exists on disk but not in the project system.
In MPFProj this reports an error that the folder already exists.
In C# this adds the existing folder.
The difference here is that MPFProj always immediately adds the folder including attempting to create the directory. The C# project system waits until the call to SetEditLabel to actually do the work of creating the directory and doesn't care if it already exists.


dinov wrote Dec 7, 2011 at 11:14 PM

KlausGuetter wrote Jan 13, 2012 at 6:57 AM

The proposed fix has a problem with subordinate folders: the VirtualNodeName is set wrong in this case which leads to the problem that files added to the new subordinate folder A\B\C end up in projectdir\C.

To fix, replace the line
this.VirtualFolderName = filename;
this.VirtualFolderName = Path.Combine(Parent.VirtualFolderName, filename);
in FinishFolderAdd

wrote Feb 14, 2013 at 2:58 AM