summaryrefslogtreecommitdiff
path: root/tests/projects/csharp/console_with_runtime_json/src/Program.cs
diff options
context:
space:
mode:
authorJassJam <[email protected]>2026-02-23 12:28:50 +0000
committerruki <[email protected]>2026-03-14 00:08:40 +0800
commit9946d1814f4af9ef67e5accd9404e0fc69290f6f (patch)
treef669ea003ab4947aabb7732696aefa4e62f5793c /tests/projects/csharp/console_with_runtime_json/src/Program.cs
parent95fa1f158a4044b9851ce6c0f4ff21f3427ce83e (diff)
feat: add initial test files
Diffstat (limited to 'tests/projects/csharp/console_with_runtime_json/src/Program.cs')
-rw-r--r--tests/projects/csharp/console_with_runtime_json/src/Program.cs17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/projects/csharp/console_with_runtime_json/src/Program.cs b/tests/projects/csharp/console_with_runtime_json/src/Program.cs
new file mode 100644
index 000000000..2c9b0783b
--- /dev/null
+++ b/tests/projects/csharp/console_with_runtime_json/src/Program.cs
@@ -0,0 +1,17 @@
+using System.Text.Json;
+
+var runtimeFile = Path.Combine(AppContext.BaseDirectory, "runtime.json");
+if (!File.Exists(runtimeFile))
+{
+ Console.WriteLine("runtime.json missing");
+ return;
+}
+
+var json = File.ReadAllText(runtimeFile);
+using var doc = JsonDocument.Parse(json);
+var runtime = doc.RootElement.TryGetProperty("runtime", out var value)
+ ? value.GetString()
+ : "unknown";
+
+Console.WriteLine($"runtime={runtime}");
+