Geolocation error on Windows 7

Phunction 201 Reputation points
2022-06-17T15:36:52.747+00:00

I am hoping someone has and hint for me. I have an app that uses windows geolocation service, works fine on Windows 10/11 but I am trying to get it to work on Windows 7.
The error I get is:
could not find windows type windows.devices.geolocation.geolocator
system.platformnotsupportedexception: operation is not supported on this platform

From what I can find, windows 7 should support that class so not sure why it says it cannot be found?
My project has the references to System.Runtime.dll, System.Runtime.WindowsRuntime.dll and System.Runtime.InteropServices.WindowsRuntime.dll

Windows Forms
Windows Forms
A set of .NET Framework managed libraries for developing graphical user interfaces.
1,827 questions
Windows
Windows
A family of Microsoft operating systems that run across personal computers, tablets, laptops, phones, internet of things devices, self-contained mixed reality headsets, large collaboration screens, and other devices.
4,740 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Ken Tucker 5,846 Reputation points
    2022-06-18T10:33:39.503+00:00

    Sorry but this class is not supported on windows 7. It was introduced for the windows 10 uwp projects

    https://learn.microsoft.com/en-us/uwp/api/Windows.Devices.Geolocation.Geolocator?view=winrt-22621