Fix: directory not found issue
This commit is contained in:
parent
3b618215eb
commit
e8c7fe0c9c
1 changed files with 3 additions and 0 deletions
|
@ -12,6 +12,9 @@
|
||||||
<Task>
|
<Task>
|
||||||
<Using Namespace="System.IO" />
|
<Using Namespace="System.IO" />
|
||||||
<Code Type="Fragment" Language="cs">
|
<Code Type="Fragment" Language="cs">
|
||||||
|
var dir = Path.GetDirectoryName(Path);
|
||||||
|
if(!string.IsNullOrEmpty(dir))
|
||||||
|
Directory.CreateDirectory(dir);
|
||||||
File.WriteAllText(Path, Content);
|
File.WriteAllText(Path, Content);
|
||||||
</Code>
|
</Code>
|
||||||
</Task>
|
</Task>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue