-2

I have a visual studio solution with many projects in it. Among them one of the project is for desktop app too named as ProjDesktop. Also one of the Project ProjWeb web project in ASP.Net MVC 5.

Behaviour expected: I want to install a Nu-Get package to my Web Project (ProjWeb).

Solution Attempted: I made the ProjWeb as start up project and ran below command in Package Manager Console:

Install-Package foolproof -Version 0.9.4518

Issue: Package got installed in ProjDesktop but I wanted it to get installed to ProjWeb as I kept that as StartUp Project.

Question:

  1. How can I target a nu-get package to a particular project? Or is it totally Okey for the package to get installed to another project. And I need to add reference or something?
  2. Once I install the nu-get package (FoolProof), is there any additional steps required before I start using it. Like manually adding Reference or Something?

P.S: I am a beginner so can someone please guide me here.

Unbreakable
  • 7,776
  • 24
  • 90
  • 171

1 Answers1

1

Use the -ProjectName parameter:

Install-Package foolproof -Version 0.9.4518 -ProjectName ProjWeb
DavidG
  • 113,891
  • 12
  • 217
  • 223
  • Sir, your solution worked. But Can you kindly tell me how to verify if that package got added in the project. I mean when I click on references for ProjWeb. I do not see anything like "FoolProof". Am I looking at the wrong place? – Unbreakable Sep 20 '17 at 14:46
  • I have no idea what FoolProof is so can't really help. If it's a normal DLL reference then you should see an entry in there. – DavidG Sep 20 '17 at 14:49
  • @Unbreakable you dont need to add a reference manually like that, after installing the package, it should be ready to use in your code – mxmissile Sep 20 '17 at 14:53
  • @mxmissile: Sir, you are right. I was looking for exact name as "FoolProof" But it is added as "FoolProofValidation" in reference. Oversight on my end. Sry about that. – Unbreakable Sep 20 '17 at 15:20