3

I am new to background task in windows store app.

I need to use the same library (Newtonsoft.json) in both foreground app and in my windows runtime component (background task).

Please how can I achieve this?

I installed it with nuget but I can use it only in my foreground app.

I have VS 2013 Express for Windows

eeadev
  • 3,662
  • 8
  • 47
  • 100

2 Answers2

0

1-You can install package to all projects in solution using this script inside Package Manager Console

Get-Project -All | Install-Package Newtonsoft.Json

2-You can change the default project in Package Manager, change it to the background project. enter image description here then install your package Install-Package Newtonsoft.Json

3-You can also check this answer to a similar question

Tools > Library Package Manager > Manage NuGet Packages for Solution... Link

Community
  • 1
  • 1
0

There are a few ways you can do this.

  1. Ahmed Rashad's method works if you want to install it in all of your projects. To limit the projects you just name the project individually or in a comma-delimited list, i.e.

    Get-Project , | Install-Package Newtonsoft.Json

  2. You can also right-click the project you want to install it in and select Manage Nuget Packages and install it from the Online source (Left Navigation Pane).

  3. Right-click the Solution, select Manage Nuget Packages for Solution then click on Installed packages on the left navigation pane. From there you just find the package you want in the center navigation pane and click on Manage. Select your other project and click Ok.

The first option is the easiest and quickest IMO.

Derek Van Cuyk
  • 953
  • 7
  • 23