0

I am working on window phone app.In it i have added another new project that is Schedule Agent that work in background.I have added reference of agent in foreground but when i am adding reference of foreground in agent it gives message about circular dependency.How can I solve this problem? Actually i want to access local database in both agent and foreground but unable to do that.

Ritesh Gupta
  • 171
  • 1
  • 2
  • 19

2 Answers2

0

You can either:

  1. put your shared code in the library that contains the agent and only reference that from the app, or
  2. create a new library project where you put your shared code, and reference this new project from both your app and your agent.

As @entropy has pointed out, in either case you need to be aware that any code or any library referenced from the agent can't contain a call to an API which is banned by the agent.

Paul Annetts
  • 9,554
  • 1
  • 27
  • 43
  • Exactly,i am trying to put my shared code in class library.To do this i am adding reference of app in class library but when i try to add reference of background agent to class library it gives message that "Unable to add selected reference because it is not supported by background agent",since i have already added reference of agent in app.This is the problem. – Ritesh Gupta Dec 20 '12 at 07:27
  • @RiteshGupta there are some APIs that are not supported by background agent, is that the case ? – onmyway133 Dec 20 '12 at 08:26
  • @RiteshGupta: I've clarified my answer and added a link to the banned APIs (thanks @entropy) – Paul Annetts Dec 20 '12 at 08:44
0

You can create a new project with the class that you want to share among the main project and schedular task by giving reference of that to both main project and schedular agent..

Swapnika
  • 480
  • 4
  • 14