This is the base C# harness template for NativeScript Windows apps generated by the CLI.
App/main.js: JavaScript app entry.libs/: Place native runtime bridge binaries here (for examplenativescript.dll).RuntimeHost.cs: Runtime bootstrap and script execution glue.
RuntimeHost calls into the exported bridge functions:
runtime_install_ctrlc_handler(exitCode)runtime_init(appRoot)runtime_runscript(runtime, script)runtime_deinit(runtime)
app/main.js includes runtime conformance checks for:
Class.extend({ ... })Class.extend("Name", { ... })new SomeInterface({ ... })Object.extend({ interfaces: [...], ... })- delegate/event helper semantics (
NSWinRT.asDelegate,NSWinRT.createEventEmitter)
The script prints per-test lines and a summary:
[PASS] <test name>[FAIL] <test name> - <reason>[TEST SUMMARY] passed=X, failed=Y
From workspace root:
- Build bridge DLL:
cargo build -p nativescript
- Copy script and DLL:
copy /Y NativeScriptWindowsDemo\\app\\main.js ConsoleNativeScriptWindowsDemo\\app\\main.jscopy /Y target\\debug\\nativescript.dll ConsoleNativeScriptWindowsDemo\\libs\\nativescript.dll
- Run harness:
dotnet run --project ConsoleNativeScriptWindowsDemo\\ConsoleNativeScriptWindowsDemo.csproj
- Ensure
nativescript.dllexists underNativeScriptWindowsDemo/libs. - Build and deploy
NativeScriptWindowsDemo.slnfrom Visual Studio (Debug/x64 recommended for dev). - Inspect Debug Output for the same PASS/FAIL summary lines.
The CLI should:
- Copy/produce runtime binaries into
libs/. - Populate
app/main.js(or additional files underapp/). - Build/deploy the UWP app project.
app and libs are copied to output via wildcard include in NativeScriptWindowsDemo.csproj.
- This harness is intentionally minimal and template-friendly.