Error with GetCellsInfoAsync: System.Exception: Generic Failure (Exception from HRESULT: 0x80548212)

Yaguang Ruan 20 Reputation points
2024-09-27T07:49:58.0633333+00:00

I am trying to retrieve cell information from a mobile broadband network in my UWP application using GetCellsInfoAsync(). However, I am getting the error: System.Exception: Generic Failure. (Exception from HRESULT: 0x80548212). I have checked that there is an available mobile broadband account and network. Can someone help me figure out why this error is occurring?

Here is the code I am using:

 var mobileBroadbandAccounts = MobileBroadbandAccount.AvailableNetworkAccountIds;
                if (mobileBroadbandAccounts == null || mobileBroadbandAccounts.Count == 0)
                {
                    Logger.Log("没有可用的移动宽带账户");
                    return;
                }

                Logger.Log($"移动宽带账户数量: {mobileBroadbandAccounts.Count}");

                var mobileBroadbandAccount = MobileBroadbandAccount.CreateFromNetworkAccountId(mobileBroadbandAccounts[0]);
                if (mobileBroadbandAccount == null)
                {
                    Logger.Log("无法创建移动宽带账户");
                    return;
                }

                Logger.Log($"NetworkAccountId: {mobileBroadbandAccount.NetworkAccountId}");

                var mobileBroadbandNetwork = mobileBroadbandAccount.CurrentNetwork;
                if (mobileBroadbandNetwork == null)
                {
                    Logger.Log("当前没有可用的移动宽带网络");
                    return;
                }

                var cellsInfo = await mobileBroadbandNetwork.GetCellsInfoAsync();
                if (cellsInfo == null)
                {
                    Logger.Log("无法获取小区信息");
                    return;
                }
Windows for business Windows Client for IT Pros User experience Other
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Anonymous
    2024-09-30T08:40:32.64+00:00

    Hello Yaguang Ruan,

    Thank you for posting in Q&A forum.

    Error code 0x80548212 often indicates an issue with the underlying COM component or a problem in the interaction between your application and the COM library.

    1. Ensure that the COM components your application relies on are properly registered. You can use tools like regsvr32 to register DLLs.
    2. Verify that your application has the necessary permissions to access the COM components. Running your application with elevated privileges might help.
    3. Check the application logs and any diagnostic information available. This can provide more details about what might be causing the failure.

    I hope the information above is helpful.

    If you have any questions or concerns, please feel free to let us know.

    Best Regards,

    Daisy Zhou

    ============================================

    If the Answer is helpful, please click "Accept Answer" and upvote it.


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.