0

I have a library that I need added to 10 other projects in my solution. It's not on Nuget, and it's only local on my machine.

Is there a Powershell approach (similar to Nuget Install-package ) that will allow me to add a specific reference to several *.csproj files?

makerofthings7
  • 60,103
  • 53
  • 215
  • 448

2 Answers2

0

When you can create an .net-based assembly of your reference, you can add it simply with

Import-Module c:\path\to\your\assembly.dll

Using the assembly looks like this:

Example Usual Class:

$var = New-Object [Your.Namespace]::Classname(Constructor Arguments)

Example Static Class:

$var = [Your.Namespace]::Class.Method(Arguments)

Hope, this helps...

Edit: It seems, i've misunderstood your problem :(. Sorry about that.

Greetings, Ronny

Ronny Kaufmann
  • 446
  • 2
  • 7
0

I think one approach would be to create a nuget package for your library, store it on your local drive in a specific directory, add that directory to your package sources, then open the Package Manager Console from your solution and issue a:

Get-Project -All | Install-Package <your package name>
David Brabant
  • 41,623
  • 16
  • 83
  • 111