You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have searched issues to ensure it has not already been reported
Cake runner
Cake .NET Tool, Cake Frosting, Cake runner for .NET Framework, Cake runner for .NET Core
Cake version
1.1.0
Operating system
N/A
Operating system architecture
N/A
CI Server
N/A
What are you seeing?
When Cake addins reference assemblies that have already been loaded by Cake, and the version loaded in the assembly load context doesn't match the version targeted by the Cake addin, the user sees a warning written to the Console (even with the default Verbosity).
For example, using the latest version (as of this writing) of the Cake.ExtendedNuGet addin (v4.0.2) with the latest version of Cake (v1.1.0) produces the following warning:
(3145,12): warning CS1701: Assuming assembly reference 'NuGet.Versioning, Version=5.4.0.3, Culture=neutral, PublicKeyToken=31bf3856ad364e35' used by 'Cake.ExtendedNuGet' matches identity 'NuGet.Versioning, Version=5.8.1.7021, Culture=neutral, PublicKeyToken=31bf3856ad364e35' of 'NuGet.Versioning', you may need to supply runtime policy
This happens because Cake references a newer version of the NuGet packages (v5.8.1) whilst the latest version of the Cake.ExtendedNuGet addin references an older version of NuGet (v5.4.0) which is still compatible, but different. More details described in cake-contrib/Cake.ExtendedNuGet#35 (comment)
What is expected?
These warnings should be suppressed given that they provide little value to the Cake user (i.e. NuGet upgrades are a common scenario when loading transitive dependencies) and there's nothing that the user can do about it other than ignoring the "noise".
There seems to be general agreement in the .NET community and within Microsoft that these warnings should be suppressed by default and potentially completely removed (1).
I propose suppressing the warnings CS1701, CS1702 and CS1705 completely, or at the very least, changing its severity so that it only appears when running Cake with Diagnostic verbosity.
Prerequisites
Cake runner
Cake .NET Tool, Cake Frosting, Cake runner for .NET Framework, Cake runner for .NET Core
Cake version
1.1.0
Operating system
N/A
Operating system architecture
N/A
CI Server
N/A
What are you seeing?
When Cake addins reference assemblies that have already been loaded by Cake, and the version loaded in the assembly load context doesn't match the version targeted by the Cake addin, the user sees a warning written to the Console (even with the default Verbosity).
For example, using the latest version (as of this writing) of the Cake.ExtendedNuGet addin (v4.0.2) with the latest version of Cake (v1.1.0) produces the following warning:
This happens because Cake references a newer version of the NuGet packages (v5.8.1) whilst the latest version of the
Cake.ExtendedNuGet
addin references an older version of NuGet (v5.4.0) which is still compatible, but different. More details described in cake-contrib/Cake.ExtendedNuGet#35 (comment)What is expected?
These warnings should be suppressed given that they provide little value to the Cake user (i.e. NuGet upgrades are a common scenario when loading transitive dependencies) and there's nothing that the user can do about it other than ignoring the "noise".
There seems to be general agreement in the .NET community and within Microsoft that these warnings should be suppressed by default and potentially completely removed (1).
These warnings have had to be disabled in project templates for a long time. Searching for "NoWarn" 1701 on GitHub at the moment yields over 500K results: https://github.com/search?q=NoWarn+1701&type=Code&utf8=%E2%9C%93
I propose suppressing the warnings
CS1701
,CS1702
andCS1705
completely, or at the very least, changing its severity so that it only appears when running Cake withDiagnostic
verbosity.Steps to Reproduce
build.cake
file:dotnet cake
Output log
No response
The text was updated successfully, but these errors were encountered: