none
Creating an appointment in a UWP app crashes the app RRS feed

  • Question

  • I am currently trying to port my app Week View to an UAP app so it can be used on all windows 10 devices.

    The package.appxmanifest file contains the required permissions to access the calendar.

      <Capabilities>
        <Capability Name="internetClient" />
        <uap:Capability Name="appointments"/>
      </Capabilities>

    I am Creating an AppointmentManager, specifying that I want to read and write to the calendar.

    var appointmentManager = await AppointmentManager.RequestStoreAsync(AppointmentStoreAccessType.AllCalendarsReadWrite)

    When executing this line of code in VS2015, running on my "Local Machine" (which is running Windows 10), the app crashes immediately:

    'System.UnauthorizedAccessException' in mscorlib.ni.dll ("Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))")

    I also tried it on a windows phone, running the most recent windows mobile 10 developer preview build and I got an exception too:

    Exception thrown: 'System.UnauthorizedAccessException' in mscorlib.ni.dll

    This means: At the moment I am not able to port my app Week View to an UWP app since the most basic feature "creating an appointment" is not working with UWP. :( 
    Of course all other app developers will have the same issue.

    Are there any other permissions I need to add to the package.appxmanifest file?
    Since I am getting an "UnauthorizedAccessException" I guess it must have something to do with app permissions?

    This problem is very simple to reproduce:

    1. Create a new universion windows 10 app

    2. Add "appointments" capability to the package.appxmainfest files

    3. Call "AppointmentManager.RequestStoreAsync(AppointmentStoreAccessType.AllCalendarsReadWrite);" in your app code.

    Please MS support try to reproduce this and provide us with a solution that allows app developers to port their calendar apps to an UWP app.

    best regards,
    Hannes


    • Edited by HannesBiri Friday, September 18, 2015 9:06 PM
    Friday, September 18, 2015 7:11 AM

Answers

  • Hello HannesBiri,

    We can reproduce your issue with the above steps. So we checked the Calender app in Windows 10 and saw the following under Capability :

    <rescap:Capability Name="appointmentsSystem"/>

    Please remember to add the following in the package.manifest file:

    xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities"

    Then when you build again you can find your app does not crash with access denied error.

    The description of this issue is under this MSDN article:App capability declarations

    See the  System Level Appointment Access part, it is restricted capability so we need the following tag:

     rescap:Capability

    Best regards,

    Barry


    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 HannesBiri Monday, September 21, 2015 7:41 PM
    Monday, September 21, 2015 5:43 AM
    Moderator

All replies

  • Hello HannesBiri,

    We can reproduce your issue with the above steps. So we checked the Calender app in Windows 10 and saw the following under Capability :

    <rescap:Capability Name="appointmentsSystem"/>

    Please remember to add the following in the package.manifest file:

    xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities"

    Then when you build again you can find your app does not crash with access denied error.

    The description of this issue is under this MSDN article:App capability declarations

    See the  System Level Appointment Access part, it is restricted capability so we need the following tag:

     rescap:Capability

    Best regards,

    Barry


    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 HannesBiri Monday, September 21, 2015 7:41 PM
    Monday, September 21, 2015 5:43 AM
    Moderator
  • Hi Barry,

    many thanks, this works !!

    ...which is a bit unexpected, after reading the documentation from the link you sent me since it says:

    ...In contrast, restricted capabilities do not require a special company account for the Store, they are not available for developers to use. Restricted capabilities are available only to apps that are developed by Microsoft and its partners...

    I am an app developer that likes to support the windows platforms by creating apps for it - did not know that I am a "partner" that is allowed to use this capability. :)

    Anyway of course I am glad that it's working!

    greetings,
    Hannes

    Monday, September 21, 2015 7:41 PM
  • Interesting.. but its a resticted capability.. in W10 all developers can access those?

    Or some are accessible to all and others not?

    Thursday, October 29, 2015 8:16 AM
  • Did you already try publishing your app (or did you try running Windows App Certification Kit on your development machine)? My app fails in WACK tests if trying to use that capability. So as the documentation says, "Restricted capabilities are available only to apps that are developed by Microsoft and its partners.". I am sure you would know if you were a partner, so you most probably are not.

    Sunday, December 13, 2015 7:56 PM
  • Amazing!
    Tuesday, February 16, 2016 12:59 AM