diff --git a/SMGen/Pages/SMEvent2State.razor.cs b/SMGen/Pages/SMEvent2State.razor.cs index 40064d9..10c7d4d 100644 --- a/SMGen/Pages/SMEvent2State.razor.cs +++ b/SMGen/Pages/SMEvent2State.razor.cs @@ -428,10 +428,11 @@ namespace SMGen.Pages } //creo file - await using FileStream fs = new(pathFile, FileMode.Create); - - //copio il contenuto del file - await file.OpenReadStream(maxFileSize).CopyToAsync(fs); + using (FileStream fs = new(pathFile, FileMode.Create)) + { + //copio il contenuto del file + await file.OpenReadStream(maxFileSize).CopyToAsync(fs); + } if (file.Name.Contains(".rul")) { files2Read.Add(file.Name, pathFile); diff --git a/SMGen/Pages/SMIn2Event.razor.cs b/SMGen/Pages/SMIn2Event.razor.cs index 8b29b22..3fe0e25 100644 --- a/SMGen/Pages/SMIn2Event.razor.cs +++ b/SMGen/Pages/SMIn2Event.razor.cs @@ -474,7 +474,7 @@ namespace SMGen.Pages Log.Info($"Creato directory {pathDir}"); } - //creo file + // creo file using (FileStream fs = new(pathFile, FileMode.Create)) { // copio il contenuto del file