The following forum(s) have migrated to Microsoft Q&A (Preview): Developing Universal Windows apps, Developing Universal Windows apps!
Visit Microsoft Q&A (Preview) to post new questions.

Learn More

 locked
[UWP]Fix for ConnectionProfile.GetNetworkUsageAsync? RRS feed

  • Question

  • Hi,

    ConnectionProfile.GetNetworkUsageAsync() always returns same value for different profiles since insider build 15007. Any chance that this bug gets fixed before creators-release?

    Regards
    Frank



    Friday, March 31, 2017 4:57 PM

Answers

  • Hello,

    Thanks for reporting this issue.

    I can confirm that it is a known issue in our system and the related team is investigating this issue, once there is any update, I will post it in here.

    Thanks for your understanding.

    Best Regards,
    Amy Peng


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    • Marked as answer by frank-dev Friday, April 7, 2017 4:46 PM
    Thursday, April 6, 2017 10:21 AM
    Owner

All replies

  • Hello frank-dev,

    I’ve joined the insider preview, and then I updated my OS to 15063. I tested the following code and have not faced this issue.

    public async void GetUsageAsync()
            {
                var ConnectionProfiles = Windows.Networking.Connectivity.NetworkInformation.GetConnectionProfiles();
                DateTime current = DateTime.Now;
                DateTime starttime = current.AddHours(-1);
                System.Diagnostics.Debug.WriteLine("profile count: " + ConnectionProfiles.Count);
                foreach (var profile in ConnectionProfiles)
                {
                    var localusages =  await profile.GetNetworkUsageAsync(starttime,current,Windows.Networking.Connectivity.DataUsageGranularity.Total, new NetworkUsageStates());
    
                    System.Diagnostics.Debug.WriteLine("profile name: " +profile.ProfileName);
                    foreach (var localusage in localusages)
                    {
                        System.Diagnostics.Debug.WriteLine("Send data: " + localusage.BytesSent+" Received data: "+localusage.BytesReceived);
                    }
                }
            }

    Best Regards,

    Xavier Eoro


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, April 3, 2017 8:09 AM
  • Hello Xavier Eoro,

    to be a bit more precise, it happens for same profile-types. Did you test it on windows mobile?

    foreach (var profile in ConnectionProfiles.Where(p => p.IsWlanConnectionProfile)
    {
        var localusages = await profile.GetNetworkUsageAsync(starttime, current, Windows.Networking.Connectivity.DataUsageGranularity.Total, new NetworkUsageStates());
        // BUG: localusage.BytesSent are equal for all (different) wlan profiles
    }

    foreach (var profile in ConnectionProfiles.Where(p => p.IsWwanConnectionProfile)
    {
        var localusages = await profile.GetNetworkUsageAsync(starttime, current, Windows.Networking.Connectivity.DataUsageGranularity.Total, new NetworkUsageStates());
        // BUG: localusage.BytesSent are again equal for all (different) mobile profiles
    }

    Regards

    Frank

     

    Monday, April 3, 2017 7:12 PM
  • Hello,

    Thanks for reporting this issue.

    I can confirm that it is a known issue in our system and the related team is investigating this issue, once there is any update, I will post it in here.

    Thanks for your understanding.

    Best Regards,
    Amy Peng


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    • Marked as answer by frank-dev Friday, April 7, 2017 4:46 PM
    Thursday, April 6, 2017 10:21 AM
    Owner
  • Hello,

    any news on this? Since people started getting 15063 update for their phones, we have more and more customers being affected by this issue...

    Is there any official record for the problem somewhere, so we can track it or vote for fixing etc? I wanst successful in finding any other mention than this topic. Thanks in advance.

    Regards

    Jakub

    Tuesday, May 16, 2017 11:50 AM
  • Hi Jakub,

    I have contacted with the owner for this issue and they are investigating this issue, I will keep you posted once there is any update.

    Besides, if you have any issue that you want to report during developing the UWP app, you can also use the Feedback Hub app, in this way you can vote on or track the status for the issue.

    Thanks for your understanding.

    Best Regards,
    Amy Peng


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.



    Wednesday, May 17, 2017 3:04 AM
    Owner