Lack of build when using BackgroundAgent

When I try to use BackgroundAgent, I get the following error message when I open the Background Applications screen in the system settings.

The System.IO.FileNotFoundException error 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. Stack traces: in System.ThrowHelper.throwVersion37CompatException (ExceptionType newEType, String newString, ExceptionType oldEType, String oldString) in System.Reflection.Assembly.LoadFrom (String assemblyFile) in Microsoft.Phone.BackgroundAgentActivator.LoadEntryPoint Assembly .BackgroundAgentActivator.LoadAgent (String assemblyName, String typeName) on Microsoft.Phone.BackgroundAgentActivator.Microsoft.Phone.IBackgroundAgentActivator.CreateBackgroundAgent (String assembly, typeinfo string) on ​​Microsoft.Phone.BackgroundAgentDispatcher.AgentRehone.Background.AgentRehone.Background.AgentRehone.Background. .InvocationThread () in System.Threading.ThreadHelper.ThreadStartHelper (ThreadHelper t) in System.Threading.ThreadHelper.ThreadStart_Context (object state) in System.Threading.ExecutionContext.Run (ExecutionContext executeContext, of inverse challenge ContextCallback, object state) in System.Threading.ThreadHelper.ThreadStartHelper ()

I used this tutorial: http://rodrigueh.com/wp7-live-tiles-with-background-agents .

The given sample works, but when I try to implement it, it does not. Unfortunately, I can not find anything on the Internet.

Any ideas what is going on?

Regards, Niels

+4
source share
1 answer

If you look at the exception, the problem may be that you are not referencing MyAgent.dll in your main project. Add the background job as a reference and make sure it is added to your WMAppManifest.xml (replace it with the actual assembly name and task class name.)

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

Source: https://habr.com/ru/post/1438669/


All Articles