xsharp.eu • preventing recompilation
Page 1 of 1

preventing recompilation

Posted: Wed Aug 03, 2022 11:16 am
by Otto
I am changing unittests (in C#) over XSharp code. I see that XSharp code is recompiling (or at least checking it) every time, even though nothing changed.
Is there something I can do to prevent this behavior?

preventing recompilation

Posted: Wed Aug 03, 2022 12:18 pm
by Chris
Hi Otto,

I think you just need to need to go to Build -> Configuration Manager, and uncheck the "Build" checkbox from the unit test project (and any other you don't want to be automatically recompiled once a change something in a referenced library).

preventing recompilation

Posted: Wed Aug 03, 2022 1:01 pm
by Otto
hmm, are we talking about the same thing?
I don't mind that the unit tests are recompiled when I build the solution as a whole.

But when I change a unit test and want to run/debug it, then it compiles the source of the whole solution again (including the XSharp code that hasn't been changed).

So every time I'm running a specific unit test it goes through compiling all the source, resulting at the end in
========== Build: 11 succeeded, 0 failed, 12 up-to-date, 0 skipped ==========
So, the compiler sees that all is up to date.

preventing recompilation

Posted: Wed Aug 03, 2022 2:17 pm
by Chris
Hi Otto,

Well, normally VS (MSBuild) builds the projects that depend (directly or indirectly) on the code you changed, so could it be you have a reference to the unit test project
in any of your regular projects in the solution?

preventing recompilation

Posted: Wed Aug 03, 2022 3:34 pm
by robert
Otto,
Otto post=23209 userid=298 wrote:hmm, are we talking about the same thing?
I don't mind that the unit tests are recompiled when I build the solution as a whole.

But when I change a unit test and want to run/debug it, then it compiles the source of the whole solution again (including the XSharp code that hasn't been changed).

So every time I'm running a specific unit test it goes through compiling all the source, resulting at the end in
========== Build: 11 succeeded, 0 failed, 12 up-to-date, 0 skipped ==========
So, the compiler sees that all is up to date.
Are you sure that they are rebuild, or is this just the message that they are Up to date.
Does the date/time of the EXE/DLL files change ?

Robert