@@ -191,7 +191,7 @@ private async Task GenerateClassFileAsync(
191191 classTemplateEmptyPart . Replace ( NamespacePlaceholder , rootNamespace ) ;
192192
193193 var filePath = Path . Combine ( args . WorkDirectory , folder , $ "{ clientProxyName } .cs") ;
194- Directory . CreateDirectory ( Path . GetDirectoryName ( filePath ) ! ) ;
194+ DirectoryHelper . CreateIfNotExists ( Path . GetDirectoryName ( filePath ) ! ) ;
195195 if ( ! File . Exists ( filePath ) )
196196 {
197197 using ( var writer = new StreamWriter ( filePath ) )
@@ -227,7 +227,7 @@ private async Task GenerateClassFileAsync(
227227 classTemplate . Replace ( $ "{ Environment . NewLine } { Environment . NewLine } { MethodPlaceholder } ", string . Empty ) . Replace ( MethodPlaceholder , string . Empty ) ;
228228
229229 filePath = Path . Combine ( args . WorkDirectory , folder , $ "{ clientProxyName } .Generated.cs") ;
230- Directory . CreateDirectory ( Path . GetDirectoryName ( filePath ) ! ) ;
230+ DirectoryHelper . CreateIfNotExists ( Path . GetDirectoryName ( filePath ) ! ) ;
231231 using ( var writer = new StreamWriter ( filePath ) )
232232 {
233233 await writer . WriteAsync ( classTemplate . ToString ( ) ) ;
@@ -257,7 +257,7 @@ private async Task GenerateClassFileAsync(
257257 interfaceTemplate . Replace ( NamespacePlaceholder , rootNamespace ) ;
258258
259259 filePath = Path . Combine ( args . WorkDirectory , folder , $ "{ appServiceTypeName } .cs") ;
260- Directory . CreateDirectory ( Path . GetDirectoryName ( filePath ) ! ) ;
260+ DirectoryHelper . CreateIfNotExists ( Path . GetDirectoryName ( filePath ) ! ) ;
261261 using ( var writer = new StreamWriter ( filePath ) )
262262 {
263263 await writer . WriteAsync ( interfaceTemplate . ToString ( ) ) ;
0 commit comments