question

Phunction-1104 avatar image
0 Votes"
Phunction-1104 asked Phunction-1104 edited

Geolocation error on Windows 7

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-formswindows-7
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

vb2ae avatar image
0 Votes"
vb2ae answered Phunction-1104 edited

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

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

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

It looks like GeoCoordinateWatcher will work but from what I have been reading it does not work in the background. Does this mean when the app is in the background, or minimized, it will no longer receive location updates?

0 Votes 0 ·