0

Is .NET 4.5 mandatory for using Windows API Code Pack (Microsoft.WindowsAPICodePack and Microsoft.WindowsAPICodePack.Sensors.dll) Will it work for .NET 4.0?

The latest version of Windows API Code Pack is 1.1 but there doesn't seems to be a dedicated page for it.

pnuts
  • 58,317
  • 11
  • 87
  • 139
Raulp
  • 7,758
  • 20
  • 93
  • 155

2 Answers2

3

The library was published when Windows 7 was released (replacing the "Vista Bridge" library), and targets the .NET Framework version that is pre-installed on Win7, version 3.5. You cannot go lower than 3.5, it has a dependency on System.Core.dll. Targeting .NET 4.x is not a known problem.

Do keep the target operating system requirement in mind for the Sensor api, the underlying COM interface (ISensor et al) requires Windows 7 or higher and is not available on the Server edition.

Hans Passant
  • 922,412
  • 146
  • 1,693
  • 2,536
2

The actual code of the Windows API Code Pack is compatible with .NET 3.5 and above. .NET 4 or 4.5 certainly won't be a problem.

I just downloaded the NuGet package using Install-Package WindowsAPICodePack-Core and it works for .NET 3.5.

Patrick Hofman
  • 153,850
  • 22
  • 249
  • 325