Are ESim related WinRT APIs require Package Identity?

Jayden Xia 20 Reputation points
2024-10-11T06:40:18.12+00:00

Hi, team

I am trying to use WinRT API (under name space Windows.Networking.NetworkOperators) to read ESim ID on my laptop. I created a UWP App and this api worked. However the project i'm working on is not a UWP app and it's based on .NET 4.6. I imported WinRT APIs by nuget and tested two classes under this namespace (MobileBroadbandModem and EsimManager). MobileBroadbandModem returned the information successfully but EsimManager failed when i tried to call EsimManager.TryCreateESimWatcher(). This function just returned null. I saw that there are some APIs require Package Identity to work normally. But I didn't see Windows.Networing.NetworkOperators on the list. So could you please tell me if this funtion requires Package Identity? If not, what's the possible reason that this funtion works in a UWP App but fails in my project on the same device? Thanks.

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.
5,517 questions
Universal Windows Platform (UWP)
Windows Presentation Foundation
Windows Presentation Foundation
A part of the .NET Framework that provides a unified programming model for building line-of-business desktop applications on Windows.
2,785 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
11,032 questions
Windows 10 Network
Windows 10 Network
Windows 10: A Microsoft operating system that runs on personal computers and tablets.Network: A group of devices that communicate either wirelessly or via a physical connection.
2,363 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.