[Mono-list] System.IO.DirectoryNotFoundException: Could not find a part of the path

Sascha Manns Sascha.Manns at mailbox.org
Mon Feb 6 21:53:35 UTC 2017


Am Montag, den 06.02.2017, 14:36 +0100 schrieb Sascha Manns:
> I removed now the relative path from EntityfileLocal and used:
> 
> private static string ProjectDir => Targetdir +
> Path.DirectorySeparatorChar + PublicationTitle +
>                                     Path.DirectorySeparatorChar +
> Language + Path.DirectorySeparatorChar;
> Directory.SetCurrentDirectory(ProjectDir); // is in that case
> /home/sascha/Dokumente/publican-xcom/articles/Test/de-DE/
> 
> The directory is created in the method before that one and it's
> filled:
> 
> sascha at sascha-desktop:~/Dokumente/publican-xcom/articles/Test/de-DE$
> ls
> Article_Info.xml  Author_Group.xml  images  Revision_History.xml  Tes
> t.ent  Test.xml
> 
> But after SetCurrentDirectory i'm getting:
> 
> System.IO.DirectoryNotFoundException: Directory
> "/home/sascha/Dokumente/publican-xcom/articles/Test/de-DE/" not found
> 
> The directory is in my /home/sascha and it's writable and accessable.
I found out something. The last method which will be executed before my
try to access with Directory.SetCurrentDirectory is:

private static void CreateDocu(string createstring)
{
    var startInfo = new ProcessStartInfo
    {
        FileName = @"/usr/bin/publican",
        Arguments = @"" + createstring
    };
    Process.Start(startInfo);
}

This process creates the needed directories and it looks like my
program doesn't wait for finishing the started process. But what can i
do that the Directory.SetCurrentDirectory waits 10 seconds or so?

Greetings
Sascha
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.dot.net/pipermail/mono-list/attachments/20170206/5a052184/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: This is a digitally signed message part
URL: <http://lists.dot.net/pipermail/mono-list/attachments/20170206/5a052184/attachment.sig>


More information about the Mono-list mailing list