I am getting the following exception when I call CompositionCapabilities.GetForCurrentView
.
System.UnauthorizedAccessException: 'Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))'
public App()
{
this.InitializeComponent();
this.Suspending += OnSuspending;
// Exception happens here.
var capabilities = CompositionCapabilities.GetForCurrentView();
}
The weird thing is the code compiles OK so I assume the API is available. Do I need to declare any capabilities in Package.appxmanifest?