本文介绍了在新的ControlChannelTrigger(WinRT)中访问被拒绝(HRESULT 0x80070005)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我完全绝望了...
这是我的代码:
ControlChannelTrigger theChannel = new ControlChannelTrigger("channelId", 15, ControlChannelTriggerResourceType.RequestHardwareSlot);
总是抛出UnauthorizedAccessException(HRESULT 0x80070005).
which always throws an UnauthorizedAccessException (HRESULT 0x80070005).
这是我使用的清单
<?xml version="1.0" encoding="utf-8"?>
<Package xmlns="http://schemas.microsoft.com/appx/2010/manifest">
<Identity Name="cf45d5c8-2936-4d1f-9075-51a87ceb60ba" Publisher="CN=snuk182" Version="1.0.0.0" />
<Properties>
<DisplayName>Applic</DisplayName>
<PublisherDisplayName>snuk182</PublisherDisplayName>
<Logo>Assets\StoreLogo.png</Logo>
</Properties>
<Prerequisites>
<OSMinVersion>6.2.0</OSMinVersion>
<OSMaxVersionTested>6.2.0</OSMaxVersionTested>
</Prerequisites>
<Resources>
<Resource Language="x-generate" />
</Resources>
<Applications>
<Application Id="App" Executable="$targetnametoken$.exe" EntryPoint="Applic.App">
<VisualElements DisplayName="Applic" Logo="Assets\Logo.png" SmallLogo="Assets\SmallLogo.png" Description="Applic" ForegroundText="light" BackgroundColor="#464646" ToastCapable="true">
<LockScreen Notification="badgeAndTileText" BadgeLogo="ImageResources\badge.png" />
<DefaultTile ShowName="allLogos" WideLogo="ImageResources\widelogo.png" />
<SplashScreen Image="Assets\SplashScreen.png" />
</VisualElements>
<Extensions>
<Extension Category="windows.backgroundTasks" Executable="$targetnametoken$.exe" EntryPoint="Applic.BackgroundTask">
<BackgroundTasks>
<Task Type="controlChannel" />
</BackgroundTasks>
</Extension>
</Extensions>
</Application>
</Applications>
<Capabilities>
<Capability Name="removableStorage" />
<Capability Name="internetClient" />
</Capabilities>
</Package>
在此处或在网络上均未找到任何答案.不知道发生了什么事...
Have not found any answer either here or in web. Have no idea what's going on...
推荐答案
最初,我无法弄清楚如何在系统设置中将我的应用程序标记为锁屏应用程序",但是在这里找到了并想分享
Originally i couldnt figure out how to "mark my application as Lock Screen app in System Settings" but found it here and wanted to share
这篇关于在新的ControlChannelTrigger(WinRT)中访问被拒绝(HRESULT 0x80070005)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!