locked
[W8.1]Circular dependency when using the same library in background task and in App RRS feed

  • Question

  • My windows store app is using the lib Newtonsoft.json and is using a background task (Windows runtime component).

    Now I need to use Newtonsoft in my background task but when I try to reference it, I get such a message: "if you add your project as reference, you will get a circular dependency".

    Please how to avoid it and finally use newtonsoft in my bg task as well?


    s


    Wednesday, July 22, 2015 12:36 PM

Answers

  • Yes of course I have. If you do it the way you see there it works quite well. Just make sure there aren't other rogue references messing you up.
    Thursday, July 23, 2015 6:02 AM

All replies

  • So newtonsoft is using a background task and you want the same background task to use newtonsoft? (sounds impossible to me).
    Wednesday, July 22, 2015 12:40 PM
  • no, sorry I wasnt clear: I want to use newtonsoft both in my app and in my bgtask

    s

    Wednesday, July 22, 2015 12:53 PM
  • so then add newton soft as reference to both of them...

    Wednesday, July 22, 2015 1:06 PM
  • so then add newton soft as reference to both of them...

    Now I need to use Newtonsoft in my background task but when I try to reference it, I get such a message: "if you add your project as reference, you will get a circular dependency".

    s

    Wednesday, July 22, 2015 1:12 PM
  • DIRECTLY add newtonsoft as a reference to both of them.

    What you are doing right now is adding newtonsoft to foreground app, and then try to add reference to foreground app from the runtime component, while the foreground app already references the runtime component.

    Really, this is easy to figure out...

    Wednesday, July 22, 2015 1:22 PM
  • using VS2013, I add a reference this way:  right key on app -> add reference

    if I select both app and background task and I do right key, I dont have "add reference" in my menu. Please How do you mean to do that? Thanks 


    s

    Wednesday, July 22, 2015 1:29 PM
  • You have a lack of understanding how the reference works. I will show you a picture.
    Wednesday, July 22, 2015 1:55 PM
  • mcosmin, this is very clear to me. Did u ever try to add the same reference to bgtask and to foreground app? If yes, please let me know how if you want to help. Thanks

    s

    Wednesday, July 22, 2015 2:03 PM
  • Yes of course I have. If you do it the way you see there it works quite well. Just make sure there aren't other rogue references messing you up.
    Thursday, July 23, 2015 6:02 AM