Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio Project dependencies

I have a Visual Studio .Net Solution which has many projects/libraries.

When I work locally on my own PC there is no problem as I tend to recompile those libraries that I have just changed and everything is in sync.

The problem is sometimes other developers who once in a while require to work on or look at my code have an enormous problem recompiling everything.

In the configuration Manager, I do not have all projects checked else it would take too long to build everything whislt working.

Problem is when the solution is compiled on another application, some of the errors reported say a particular library has error and its taking too long to figure out all the dependencies compiling each one individually.

Even when checking everything in the config manager it still does not seem to compile correctly.

I thought when you add a reference to a library the dependencies are taken care of.

Is there a simple way to make sure the solution determines what are the correct dependencies and make sure everything is built in the correct order?

Thank you

like image 249
TheWommies Avatar asked Apr 14 '26 02:04

TheWommies


1 Answers

After other developers got new source codes from you, they should close Visual Studio and reopen the solution.

Sometimes there are also troubles with dependencies in Visual Studio. First, try these menu commands:

Build > Clean Solution
Build > Rebuild Solution

This will show you which dependencies are cyclic or not correct. Also, in Visual Studio project must not depend on another one which creates executable (at least for our pure C++ -written project this is true). I.e. "Utils" project which compiles into "Utils.dll" cannot depend on "MyApp" project, which exports some functions or symbols and compiles into both MyApp.exe and MyApp.lib (or some other kind of assembly). If you have such a dependency, you must correctly setup project build order and manually set MyApp.lib as in linker inputs.

like image 53
izogfif Avatar answered Apr 15 '26 21:04

izogfif



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!