wasmtime-dotnet icon indicating copy to clipboard operation
wasmtime-dotnet copied to clipboard

📝Ensure example deploy required file for local execution

Open fforjan opened this issue 1 year ago • 6 comments

The different example would work if run via dottest run as the local folder would be the one containing the wat file but if run from the binary folder, it would fail as the file woudl be missing.

This is fixing it.

fforjan avatar Jun 04 '24 22:06 fforjan

@fforjan what do you mean by but if run from the binary folder?

jsturtevant avatar Jun 28 '24 23:06 jsturtevant

@jsturtevant Execution with dotnet run :

PS C:\git\wasmtime-dotnet\examples\consumefuel> dotnet run
Added 5000 units of fuel
Called an expensive function which consumed 1000 fuel. 3998 units of fuel remaining.
Called an expensive function which consumed 1000 fuel. 2996 units of fuel remaining.
Called an expensive function which consumed 1000 fuel. 1994 units of fuel remaining.
Called an expensive function which consumed 1000 fuel. 992 units of fuel remaining.
Calling the expensive function one more time, which will throw an exception.
Exception caught with the following message:
error while executing at wasm backtrace:
    0:   0x36 - <unknown>!expensive

Caused by:
    Arithmetic operation resulted in an overflow.

which is expected.

'local execution' :

PS C:\git\wasmtime-dotnet\examples\consumefuel\bin\Debug\net8.0> .\consumefuel.exe
Unhandled exception. System.IO.FileNotFoundException: Could not find file 'C:\git\wasmtime-dotnet\examples\consumefuel\bin\Debug\net8.0\consumefuel.wat'.

the file is missing because not in the active folder ?

fforjan avatar Jul 01 '24 13:07 fforjan

if I was trying to debug from visual studio : image

fforjan avatar Jul 01 '24 13:07 fforjan

@jsturtevant let me know if you would like me to do anything on this

fforjan avatar Jul 08 '24 18:07 fforjan

nothing yet, will get to taking a look at this and a few of the other PRs by end of the week. Thanks for the patience!

jsturtevant avatar Jul 09 '24 15:07 jsturtevant

@jsturtevant any update ?

fforjan avatar Sep 10 '24 23:09 fforjan