I have a .sln package named MySolution. In that Package I have some dlls, like:
MySolution.sln
\one.dll
\second.dll
\another.dll
I want to install only specific dll to my another Project, so they will add as reference to my Project. I m trying to install like
PM> Install-Package MySolution
In that way all dlls added to my Project, but I only want some of dlls like one.dll and second.dll thats it.
Is there any way to do this?
Your options are:
Add the .dlls you do not want as assembly references as Content files.
<file src="lib\Net40\another.dll" target="content" />
This will add the .dll as a file to the project.
Add the .dlls you do not want as assembly references as Tools files.
<file src="lib\Net40\another.dll" target="tools" />
The tools directory is one of the sub directories where your package is extracted to.
Then use PowerShell to put the files into the location you need them in the project.
Or alternatively you could write a custom MSBuild target file which references the files from the tools directory. Your MSBuild target file is a just an MSBuild file where you can define properties and files just like a standard MSBuild project file. So you can reference the .dlls in the tools directory and have them copied to the output directory.