A
A
AstroMonkey2014-01-28 10:56:15
.NET
AstroMonkey, 2014-01-28 10:56:15

How to implement dependency management in a Visual Studio project?

Good day to all!
When building a project in C#, third-party libraries connected via Add reference get, along with their accompanying files, into the directory with the executable file. Is it possible to somehow specify in the build parameters how to decompose the dependencies?
PS
In Java, everything is simply solved with the help of maven (in clinical cases, ant will help you get anything and put it anywhere), put the dependencies in the right place and write their location in the manifest. I did not find any similar tools for VS.

Answer the question

In order to leave comments, you need to log in

4 answer(s)
D
Dmitry Sidorov, 2014-01-28
@AstroMonkey

It is not entirely clear what exactly the author wants. But there is a port of maven, maybe it can solve your problem: incubator.apache.org/npanday
You can also try to do it with NuGet.
You can also add the necessary files directly to the project and specify Build Action: "None" and Copy to Output Directory: "Copy If Newer" (the file will be copied from the build folder, taking into account the path from the project root).

C
cjey, 2014-01-28
@cjey

I don’t know about decomposing, but you can collect all third-party dlls into one exe using ilmerge www.microsoft.com/en-us/download/details.aspx?id=17630
Other files can be added to resources

A
AlexP11223, 2014-01-28
@AlexP11223

I didn’t quite understand what the author’s problem is, but you can use the Post build event (console commands, or it’s more convenient to create a .bat or a console application and call it there) in the project settings to copy everything you need to the required location.
There are probably more advanced systems, but I can’t advise on them, that was enough for me.

V
Vyacheslav Zolotov, 2014-01-28
@SZolotov

I may be wrong. 7 years did not work with WinForms. If you refer to a DLL that is located in another folder, then the executable will look for this folder with the DLL on startup. If this folder and DLL are not there, then it will search in the folder with the executable and in the system folders and in the folders recorded in the path environment variable. Which is very convenient if you want to show how the program works on another machine: you copy the entire folder to a USB flash drive and you don't have to do anything.
How to implement folder distribution. Handles to make folder structure for DLL. You make an installer that creates a folder structure for storage and throws DLLs into them. Previously, the installer project template built into VS was sufficient.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question