I would like to clear one concept.
In c#,
when we build(or re-build) a solution,
We sometimes get
Build: 1 succeeded
and sometimes,
Build: 1 succeeded or up-to-date
Ok, I know that something in our code would be not as per logic when we get the latter ans.
But, what does it mean CONCEPTUALLY
?
An "up-to-date" project was previously built successfully, and hasn't changed since that time, so it isn't rebuilt.
Visual Studio 2022 Blog Visual Studio 2022 version 17.4 is Available Today!
Visual Studio 2022 version 17.4 P1 is Available now ! Visual Studio 2022 version 17.3 is Available now!
Build: 1 succeeded
in general refer to successful compilation of the solution with 1
project in it.
while
Build: 1 succeeded or up-to-date
means that codes in the project within your solution has not changed, hence compilation was not needed. Hence, 1 Build Success or up-to-date
It means nothing has changed in the project. VS (well MSBUILD really), decides if it's up to date as follows:
From: How does MSBuild decide whether it needs to rebuild a C# library or not?
If you look in Microsoft.CSharp.targets (the msbuild file for compiling C# projects) the CoreCompile target has a set of Inputs and Outputs defined. These are used to do the dependency checking to see if CoreCompile needs to run. The list of inputs include the c# files, resource files, application icon, strong name key file, and other custom inputs you can define.
If you have a solution and run msbuild on it with diagnostic logging enabled (/v:diag command line parameter), you might see this message if the outputs are up to date:
Skipping target "CoreCompile" because all output files are up-to-date with respect to the input files.
The targets file is located in the .NET Framework directory (c:\windows\Microsoft.NET\Framework\v3.5 or v4.0.30319.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With