-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
24 lines (20 loc) · 742 Bytes
/
Program.cs
File metadata and controls
24 lines (20 loc) · 742 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
using System;
using Foundation;
using AppKit;
namespace net6_console_mac_sample
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Hello World!");
// System.DllNotFoundException: Could not find the runtime library libxammac.dylib
NSApplication.Init();
// [ERROR] FATAL UNHANDLED EXCEPTION: System.TypeInitializationException: TypeInitialization_Type, Foundation.NSString
var str = new NSString("test");
var num = new NSNumber(123.45);
Console.WriteLine($"str has string value {(string)str}");
Console.WriteLine($"num has float value {num.FloatValue}");
}
}
}