0

In a project "A" I am using the references of other projects(B & C). If there is a minor change in the logic in projects B & C, then do we require to build the project A.

If there is a File version of Assembly version got changed for B or C, do we need rebuild the project A

Roxana Sh
  • 294
  • 1
  • 3
  • 14
krish
  • 95
  • 7
  • 3
    Why not just try it out? Does it run as you expect if you do not re-compile the project? In general you should need to recompile only when the public interface changes. So when you just rename some (private) variable for example, there´s no need to recompile the referencing project. However we can´t know what you consider "a minor change". – MakePeaceGreatAgain Dec 03 '19 at 10:00
  • Possible duplicate of https://stackoverflow.com/questions/13751807/if-i-rebuild-a-dll-that-my-project-references-do-i-have-to-rebuild-the-project – MakePeaceGreatAgain Dec 03 '19 at 10:05
  • Thanks for the response, I want to know which is the correct way of doing. If there is a logic change in the function but function signature is not changed in the reference project. And also File version got changed in the reference project but the assembly version is not changed – krish Dec 03 '19 at 10:12
  • About which file-version are you talking? Assembly-version? – MakePeaceGreatAgain Dec 03 '19 at 10:14
  • Depends how you [built it](https://stackoverflow.com/questions/24022134/how-exactly-does-the-specific-version-property-of-an-assembly-reference-work-i). Try it and see. If it doesn't work, you might be able to get it to work with a [binding redirect](https://learn.microsoft.com/en-us/dotnet/framework/configure-apps/redirect-assembly-versions) – John Wu Dec 03 '19 at 10:15
  • I am talking about the AssemblyFileVersion [assembly: AssemblyVersion("1.6.0.1")] [assembly: AssemblyFileVersion("1.7.0.1")] – krish Dec 03 '19 at 10:19
  • then I suggest to read the mentioned duplicate. – MakePeaceGreatAgain Dec 03 '19 at 10:22
  • As long as you are inside the same solution VS will autodiscover what to build. It doesn't matter what you change in a file - the version number or just a comment, it will be rebuild. By the way most programmers refer to rebuild as the "Rebuild all" command, that's build enforment. While everything else is just build. Why are you asking ? Do you try to avoid a build ? – Holger Dec 03 '19 at 10:33
  • @Holger Here my reference dlls are coming from third party .So if there is a change in there dll I dont want to rebuild my project .Generally they third party will change the file version for the bug fixes – krish Dec 03 '19 at 10:47
  • @krish Than the third party must behave very well, and don't do any breaking changes. Nobody , except the third party, can tell or guarantee you this is going to work. If it's technically possible depends on the kind of reference. In the properties of the reference, there are two options "strong name" and "specific version". If both are set to false it's more likely to work. With "specific version=true" it enforces a specific version. Which does not mean the same dll, one could change the dll without changing version number, but that's kind of criminal energy. – Holger Dec 03 '19 at 10:53
  • Plug-Ins work this way, but this is rather loose coupling, more loading a DLL at runtime, not a staticly linked reference. – Holger Dec 03 '19 at 10:54
  • Agree, thankfully they are not making any interface changes and I am not using the specific version (specific version=false). – krish Dec 03 '19 at 10:57

1 Answers1

0

There's 'Build Dependencies' at context menu of each project, it is managing build order, and builds/rebuilds each project that the current one depends on.

Raymond Reddington
  • 1,709
  • 1
  • 13
  • 21