0
votes

I have 2 projects in 2 separate solutions

One references the other by DLL reference.

Ex: MyProjectA references MyprojectB by DLL

In ProjectB, I add an irrelevant line of code to a class file (i.e. string abc = "abc";) I rebuild ProjectB, the ProjectB.dll gets put into a directory somewhere that ProjectA is referencing

I make NO changes to ProjectA and attempt to "Build" projectA, it builds and updates the DLL. i do not want that to happen. If i run the build on projectA again, the build gets skipped since no changes have been made.

Changes to a dependency that do not directly effect calls to it from Project A should NOT effect the fact that msbuild is actually building ProjectA. This is causing problems with our versioning/signing and we're having to give the clients ALL the files again.

In other words, if i make a small change to a base project, i should only have to build that base project and redeploy the DLL for it to the client, but ALL the projects are getting built again because of the change in dependency. This is really frustrating and a problem for people on slow connections having to download everything again when we have to make a small change to a base project.

2
Could you elaborate on the versioning / signing issues? A rebuild shouldn't affect the signing. My instinct tells me that msbuild is behaving correctly. My concern is that if you do disable this behavior, you'll have problems when you change something in project B that does have an effect on project AJames Reed
james, the reason it affects the signing is because of the obfuscation going on. and it changes on every buildmoca
seems like whats happening is msbuild compares the .cs files & dependency DLLs (input) to the output(dll), and if any of the input files are newer than the output, it automatically builds. its a terrible assumption for microsoft to make here.moca

2 Answers

1
votes

You should refactor Project B into 2 class libraries (DLLs). One DLL (proj-B-core.dll) that contains the things that Project A is actually depends on... and a 2nd DLL (prod-B-misc.dll) containing the stuff that Project A does not care about. Change Project A to reference proj-B-core.dll and you will get the desired behavior.

Best, /jhd

0
votes

I'm not convinced that this is an issue with msbuild. I'd suggest investigating your versioning approach, however without more info I can't really comment. One thing that could help in this particular instance would be to use a policy redirect. This should stop you having to redistribute your entire application when only 1 assembly Reference has changed. You can just redistribute the new assembly and the policy file.