The type or namespace name 'Devices' does not exist in the namespace 'Microsoft.VisualBasic' (are you missing an assembly reference?)

Viewed 11
static ulong GetTotalMemoryInBytes()
{
    return new Microsoft.VisualBasic.Devices.ComputerInfo().TotalPhysicalMemory;
}

When I am using this code in C#, I am getting error as I have mentioned in the title. I have added Microsoft.VisualBasic reference too but I am still facing the error.

0 Answers
Related