I'm trying to get a list of the static files inside of my wwwroot folder in a Blazor WebAssembly project. This is what I've tried so far:
string[] images = Directory.GetFiles(@"wwwroot\images", "*.jpg");
I get this error:
crit: Microsoft.AspNetCore.Components.WebAssembly.Rendering.WebAssemblyRenderer[100]
Unhandled exception rendering component: Could not find a part of the path '/wwwroot\images'.
System.IO.DirectoryNotFoundException: Could not find a part of the path '/wwwroot\images'.
What am I doing wrong? Thank you.