Following script to read MAC address in C# and working fine for .Net Framework 4
macAddr =
(
from nic in NetworkInterface.GetAllNetworkInterfaces()
where nic.OperationalStatus == OperationalStatus.Up
select nic.GetPhysicalAddress().ToString()
).FirstOrDefault();
But the problem is I need to build it for .Net Framework 3
When I use .Net Framework 3 then following error occurs
Could not find an implementation of the query pattern for source type 'System.Net.NetworkInformation.NetworkInterface[]'. 'Where' not found. Are you missing a reference or a using directive for 'System.Linq'?
(are you missing an assembly reference?)
What will be the solution. Thanks in advance