Skip to content

WASM: directory created using CreateDirectory does not exist after restart #4958

@stefanolson

Description

@stefanolson

Current behavior

WASM: Directory.CreateDirectory creates the directory but only for the current session. When you restart, the directory does not exist. Using CreateFolderAsync works but that is then incompatible with my existing WPF code.

Expected behavior

Should create directory and when I load the application again the directory should exist. Not entirely clear how to verify the creation of the directory through the Google debugging tools though.

How to reproduce it (as minimally and precisely as possible)

run the enclosed project in wasm mode:
UnoApp.zip

Click open message box.
it will create a folder using the Windows storage API.
It will then create a folder using the system.io API.

restart the application. Click open message box.
it will say the folder created using the window storage API exists
it will say the folder created using the system.io API does not exist.

Workaround

been unable to find anything in the documentation around system.IO or createdirectory. It will be very difficult to rewrite my WPF code and creates a mess of file system code if I have have different file system code between WPF and Wasm. this code appears to work on android.

Environment

Nuget Package:

  • Uno.UI / Uno.UI.WebAssembly / Uno.UI.Skia
  • Uno.WinUI / Uno.WinUI.WebAssembly / Uno.WinUI.Skia
  • Uno.SourceGenerationTasks
  • Uno.UI.RemoteControl / Uno.WinUI.RemoteControl
  • Other:

Nuget Package Version(s):

Affected platform(s):

  • iOS
  • Android
  • WebAssembly
  • WebAssembly renderers for Xamarin.Forms
  • macOS
  • Skia
    • WPF
    • GTK (Linux)
    • Tizen
  • Windows
  • Build tasks
  • Solution Templates

IDE:

  • Visual Studio 2017 (version: )
  • Visual Studio 2019 (version: 16.8.3)
  • Visual Studio for Mac (version: )
  • Rider Windows (version: )
  • Rider macOS (version: )
  • Visual Studio Code (version: )

Relevant plugins:

  • Resharper (version: )

Anything else we need to know?

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions