Aragas / SystemInfoLibrary

Library for getting System Information. Supports Windows and Linux, Mac OS X, Unity.
GNU Lesser General Public License v3.0
18 stars 3 forks source link

OperatingSystemInfo.Update() is invalid in `.NETStandard,Version=v2.0` #1

Open Zaitonn opened 1 year ago

Zaitonn commented 1 year ago
// my code
using Newtonsoft.Json;
using SystemInfoLibrary.OperatingSystem;

var a = OperatingSystemInfo.GetOperatingSystemInfo();
while (true)
{
    Console.WriteLine(JsonConvert.SerializeObject(a.Update(), Formatting.Indented));
    Console.ReadKey();
}

the ram info never changed

```txt { "Architecture": "64 位", "Name": "Microsoft Windows Server 2019 Datacenter SP0.0", "FrameworkVersion": "6.0.5", "JavaVersion": "0.0", "Hardware": { "CPUs": [ { "Name": "Intel(R) Xeon(R) Platinum 8163 CPU @ 2.50GHz", "Brand": "GenuineIntel", "Architecture": "x64", "Cores": 1, "Frequency": 2500.0 } ], "GPUs": [ { "Name": "SeaBIOS VBE(C) 2011", "Brand": "Microsoft 基本显示适配器", "Resolution": "1024x768", "RefreshRate": 1, "MemoryTotal": 0 } ], "RAM": { "Free": 1459072, "Total": 2096628 } }, "OperatingSystemType": 0, "IsMono": false } { "Architecture": "64 位", "Name": "Microsoft Windows Server 2019 Datacenter SP0.0", "FrameworkVersion": "6.0.5", "JavaVersion": "0.0", "Hardware": { "CPUs": [ { "Name": "Intel(R) Xeon(R) Platinum 8163 CPU @ 2.50GHz", "Brand": "GenuineIntel", "Architecture": "x64", "Cores": 1, "Frequency": 2500.0 } ], "GPUs": [ { "Name": "SeaBIOS VBE(C) 2011", "Brand": "Microsoft 基本显示适配器", "Resolution": "1024x768", "RefreshRate": 1, "MemoryTotal": 0 } ], "RAM": { "Free": 1459072, "Total": 2096628 } }, "OperatingSystemType": 0, "IsMono": false } { "Architecture": "64 位", "Name": "Microsoft Windows Server 2019 Datacenter SP0.0", "FrameworkVersion": "6.0.5", "JavaVersion": "0.0", "Hardware": { "CPUs": [ { "Name": "Intel(R) Xeon(R) Platinum 8163 CPU @ 2.50GHz", "Brand": "GenuineIntel", "Architecture": "x64", "Cores": 1, "Frequency": 2500.0 } ], "GPUs": [ { "Name": "SeaBIOS VBE(C) 2011", "Brand": "Microsoft 基本显示适配器", "Resolution": "1024x768", "RefreshRate": 1, "MemoryTotal": 0 } ], "RAM": { "Free": 1459072, "Total": 2096628 } }, "OperatingSystemType": 0, "IsMono": false } { "Architecture": "64 位", "Name": "Microsoft Windows Server 2019 Datacenter SP0.0", "FrameworkVersion": "6.0.5", "JavaVersion": "0.0", "Hardware": { "CPUs": [ { "Name": "Intel(R) Xeon(R) Platinum 8163 CPU @ 2.50GHz", "Brand": "GenuineIntel", "Architecture": "x64", "Cores": 1, "Frequency": 2500.0 } ], "GPUs": [ { "Name": "SeaBIOS VBE(C) 2011", "Brand": "Microsoft 基本显示适配器", "Resolution": "1024x768", "RefreshRate": 1, "MemoryTotal": 0 } ], "RAM": { "Free": 1459072, "Total": 2096628 } }, "OperatingSystemType": 0, "IsMono": false } { "Architecture": "64 位", "Name": "Microsoft Windows Server 2019 Datacenter SP0.0", "FrameworkVersion": "6.0.5", "JavaVersion": "0.0", "Hardware": { "CPUs": [ { "Name": "Intel(R) Xeon(R) Platinum 8163 CPU @ 2.50GHz", "Brand": "GenuineIntel", "Architecture": "x64", "Cores": 1, "Frequency": 2500.0 } ], "GPUs": [ { "Name": "SeaBIOS VBE(C) 2011", "Brand": "Microsoft 基本显示适配器", "Resolution": "1024x768", "RefreshRate": 1, "MemoryTotal": 0 } ], "RAM": { "Free": 1459072, "Total": 2096628 } }, "OperatingSystemType": 0, "IsMono": false } { "Architecture": "64 位", "Name": "Microsoft Windows Server 2019 Datacenter SP0.0", "FrameworkVersion": "6.0.5", "JavaVersion": "0.0", "Hardware": { "CPUs": [ { "Name": "Intel(R) Xeon(R) Platinum 8163 CPU @ 2.50GHz", "Brand": "GenuineIntel", "Architecture": "x64", "Cores": 1, "Frequency": 2500.0 } ], "GPUs": [ { "Name": "SeaBIOS VBE(C) 2011", "Brand": "Microsoft 基本显示适配器", "Resolution": "1024x768", "RefreshRate": 1, "MemoryTotal": 0 } ], "RAM": { "Free": 1459072, "Total": 2096628 } }, "OperatingSystemType": 0, "IsMono": false } { "Architecture": "64 位", "Name": "Microsoft Windows Server 2019 Datacenter SP0.0", "FrameworkVersion": "6.0.5", "JavaVersion": "0.0", "Hardware": { "CPUs": [ { "Name": "Intel(R) Xeon(R) Platinum 8163 CPU @ 2.50GHz", "Brand": "GenuineIntel", "Architecture": "x64", "Cores": 1, "Frequency": 2500.0 } ], "GPUs": [ { "Name": "SeaBIOS VBE(C) 2011", "Brand": "Microsoft 基本显示适配器", "Resolution": "1024x768", "RefreshRate": 1, "MemoryTotal": 0 } ], "RAM": { "Free": 1459072, "Total": 2096628 } }, "OperatingSystemType": 0, "IsMono": false } { "Architecture": "64 位", "Name": "Microsoft Windows Server 2019 Datacenter SP0.0", "FrameworkVersion": "6.0.5", "JavaVersion": "0.0", "Hardware": { "CPUs": [ { "Name": "Intel(R) Xeon(R) Platinum 8163 CPU @ 2.50GHz", "Brand": "GenuineIntel", "Architecture": "x64", "Cores": 1, "Frequency": 2500.0 } ], "GPUs": [ { "Name": "SeaBIOS VBE(C) 2011", "Brand": "Microsoft 基本显示适配器", "Resolution": "1024x768", "RefreshRate": 1, "MemoryTotal": 0 } ], "RAM": { "Free": 1459072, "Total": 2096628 } }, "OperatingSystemType": 0, "IsMono": false } { "Architecture": "64 位", "Name": "Microsoft Windows Server 2019 Datacenter SP0.0", "FrameworkVersion": "6.0.5", "JavaVersion": "0.0", "Hardware": { "CPUs": [ { "Name": "Intel(R) Xeon(R) Platinum 8163 CPU @ 2.50GHz", "Brand": "GenuineIntel", "Architecture": "x64", "Cores": 1, "Frequency": 2500.0 } ], "GPUs": [ { "Name": "SeaBIOS VBE(C) 2011", "Brand": "Microsoft 基本显示适配器", "Resolution": "1024x768", "RefreshRate": 1, "MemoryTotal": 0 } ], "RAM": { "Free": 1459072, "Total": 2096628 } }, "OperatingSystemType": 0, "IsMono": false } { "Architecture": "64 位", "Name": "Microsoft Windows Server 2019 Datacenter SP0.0", "FrameworkVersion": "6.0.5", "JavaVersion": "0.0", "Hardware": { "CPUs": [ { "Name": "Intel(R) Xeon(R) Platinum 8163 CPU @ 2.50GHz", "Brand": "GenuineIntel", "Architecture": "x64", "Cores": 1, "Frequency": 2500.0 } ], "GPUs": [ { "Name": "SeaBIOS VBE(C) 2011", "Brand": "Microsoft 基本显示适配器", "Resolution": "1024x768", "RefreshRate": 1, "MemoryTotal": 0 } ], "RAM": { "Free": 1459072, "Total": 2096628 } }, "OperatingSystemType": 0, "IsMono": false } { "Architecture": "64 位", "Name": "Microsoft Windows Server 2019 Datacenter SP0.0", "FrameworkVersion": "6.0.5", "JavaVersion": "0.0", "Hardware": { "CPUs": [ { "Name": "Intel(R) Xeon(R) Platinum 8163 CPU @ 2.50GHz", "Brand": "GenuineIntel", "Architecture": "x64", "Cores": 1, "Frequency": 2500.0 } ], "GPUs": [ { "Name": "SeaBIOS VBE(C) 2011", "Brand": "Microsoft 基本显示适配器", "Resolution": "1024x768", "RefreshRate": 1, "MemoryTotal": 0 } ], "RAM": { "Free": 1459072, "Total": 2096628 } }, "OperatingSystemType": 0, "IsMono": false } { "Architecture": "64 位", "Name": "Microsoft Windows Server 2019 Datacenter SP0.0", "FrameworkVersion": "6.0.5", "JavaVersion": "0.0", "Hardware": { "CPUs": [ { "Name": "Intel(R) Xeon(R) Platinum 8163 CPU @ 2.50GHz", "Brand": "GenuineIntel", "Architecture": "x64", "Cores": 1, "Frequency": 2500.0 } ], "GPUs": [ { "Name": "SeaBIOS VBE(C) 2011", "Brand": "Microsoft 基本显示适配器", "Resolution": "1024x768", "RefreshRate": 1, "MemoryTotal": 0 } ], "RAM": { "Free": 1459072, "Total": 2096628 } }, "OperatingSystemType": 0, "IsMono": false } ``` here are some outputs
Zaitonn commented 1 year ago

the package named SystemInfoLibrary-devel (devel branch) seems not to have such problem :D will devel branch merge into master? and is devel branch stable to use in production env?