For a .NET solution, is there a way to get all the .dll files for each project in the solution? For example, if I make an empty .NET solution (this is Visual Studio 2010 btw), and add 3 projects called “a”, “b” and “c”, and build each, providing me with dll’s a.dll, b.dll, and c.dll, is there any code sample in either C# or Powershell which could give me a collection of of these .dlls (but not any other .dlls like 3rd party libraries used)?
Thanks
One simple way (without writing a VS addin) would be parsing the project file. The project file (which is in XML format) will have an element called ProjectReference (regular references are in another element, called
Reference):You could simply parse this, with any XML API you have in your toolset and get the name of the dll by using the name of the project (the
Includeattribute). This works of course only if your project has the same name as the dll. If it hasn’t, you could open thecsprojfile and find the element<AssemblyName>