Reputation: 233
AppDomain.CurrentDomain.BaseDirectory gives me the bin directory in server-side blazor. But when I go to client-side wasm this same call return "/". Just a root. How do I carry a file in the root of the client app and then use it in the client? Thanks!
Upvotes: 1
Views: 1419
Reputation: 417
Have a look at Assembly.GetManifestResourceStream.
Here's a stackoverflow post discussing on how to use it.
Your workaround using another service returning the resource works for applications with internet access, but is not an option in an offline scenario. In my case, I simply needed a font file and embedding the file into the assembly worked just fine.
Upvotes: 1
Reputation: 233
It seems as if it is not possible. To work around, I will be creating a service that runs on the host.
Upvotes: 0