extism / dotnet-pdk

Extism Plug-in Development Kit (PDK) for C# and F#
https://extism.org
BSD 3-Clause "New" or "Revised" License
41 stars 6 forks source link

unknown import: `env::extism_input_length` has not been defined #26

Closed Meai closed 1 year ago

Meai commented 1 year ago

Attempt: I git clone'd this repo and built the solution with no changes on my side, including the SampleCSharpPlugin. Then tried to run it.

Problem:

\bin\Debug\net8.0\wasi-wasm\AppBundle>wasmtime run SampleCSharpPlugin.wasm
Error: failed to run main module `SampleCSharpPlugin.wasm`

Caused by:
    0: failed to instantiate "SampleCSharpPlugin.wasm"
    1: unknown import: `env::extism_input_length` has not been defined

I also had to put <WASI_SDK_PATH>C:/wasi-sdk</WASI_SDK_PATH> into the project file after downloading the mingw wasi-sdk there to make it build at all, it wouldnt pick it up from the windows environment variables for some reason.

Meai commented 1 year ago

Oh I see, it's meant as a pure plugin mechanism so I have to execute the SampleHost.exe which then runs the SampleCSharpPlugin.wasm