gpt4 book ai didi

c# - 使用 BackgroundAgent 时程序集丢失

转载 作者:太空狗 更新时间:2023-10-30 01:22:47 24 4
gpt4 key购买 nike

当我尝试使用 BackgroundAgent 时,在系统设置中打开后台应用程序屏幕时收到以下错误消息。

System.IO.FileNotFoundException was unhandled Message=File or assembly name '\Applications\Install\EC78F0AC-625D-482E-9ADD-D48D58BE633A\Install\MyAgent.dll', or one of its dependencies, was not found. StackTrace: at System.ThrowHelper.throwVersion37CompatException(ExceptionType newEType, String newString, ExceptionType oldEType, String oldString) at System.Reflection.Assembly.LoadFrom(String assemblyFile) at Microsoft.Phone.BackgroundAgentActivator.LoadEntryPointAssembly(String assemblyName) at Microsoft.Phone.BackgroundAgentActivator.LoadAgent(String assemblyName, String typeName) at Microsoft.Phone.BackgroundAgentActivator.Microsoft.Phone.IBackgroundAgentActivator.CreateBackgroundAgent(String assembly, String typeinfo) at Microsoft.Phone.BackgroundAgentDispatcher.AgentRequest.Invoke() at Microsoft.Phone.BackgroundAgentDispatcher.InvocationThread() at System.Threading.ThreadHelper.ThreadStartHelper(ThreadHelper t) at System.Threading.ThreadHelper.ThreadStart_Context(Object state) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.ThreadHelper.ThreadStartHelper()

我使用了这个教程:http://rodrigueh.com/wp7-live-tiles-with-background-agents .

提供的示例有效,但当我尝试实现它时却没有。不幸的是,我无法在网上找到任何东西。

有什么想法吗?

亲切的问候,尼尔斯

最佳答案

通过查看异常,问题可能是您没有在主项目中引用 MyAgent.dll。添加后台任务作为引用,并确保将其添加到您的 WMAppManifest.xml(将其替换为实际的程序集名称和任务类的名称。)

  <ExtendedTask Name="BackgroundTask">
<BackgroundServiceAgent Specifier="ScheduledTaskAgent" Name="MyAgent" Source="MyAgent" Type="MyAgent.ScheduledAgent" />
</ExtendedTask>

关于c# - 使用 BackgroundAgent 时程序集丢失,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12801934/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com