© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•2y ago•
7 replies
hamarb123

How to create files before main and pass command line args with net8.0-browser and wasm

I'm wanting to run a .net wasm app with files pre-created (before main function), and with command line arguments. Currently I can get command line arguments to work with
dotnet.withApplicationArguments(...args).run()
dotnet.withApplicationArguments(...args).run()
, but to create files beforehand, I need the module so I can access
FS
FS
on it before running it to add the files, but whenever I do
dotnet.create()
dotnet.create()
it no longer gives me console output (it does still seem to give me the exit code though). For example,
dotnet.create().then((x) => { return x.runMainAndExit(undefined, args) }).then((x) => console.log(x))
dotnet.create().then((x) => { return x.runMainAndExit(undefined, args) }).then((x) => console.log(x))
just prints
1
1
. What am I doing wrong that I don't get console output from it?
Please ping. Thanks!
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Main() and command-line arguments
C#CC# / help
4y ago
how to downgrade from net8.0 to net7.0 in maui
C#CC# / help
3y ago
Upgrading to net8 and automapper 13.0.1 fails
C#CC# / help
2y ago
✅ How to create new cs and csproj files?
C#CC# / help
2y ago