cake icon indicating copy to clipboard operation
cake copied to clipboard

IL3000: Cake.Core.CakeEnvironment.CakeEnvironment use of Executing Assembly Location

Open devlead opened this issue 4 months ago • 0 comments

System.Reflection.Assembly.Location might return an empty string in some scenarios

https://github.com/cake-build/cake/blob/d24d5eb2cb5712330066afa0c41229a73d0e4516/src/Cake.Core/CakeEnvironment.cs#L47C13-L47C71

            var assembly = AssemblyHelper.GetExecutingAssembly();
            var path = PathHelper.GetDirectoryName(assembly.Location);

Investigate if it could be using System.AppContext.BaseDirectory instead.

devlead avatar Sep 11 '25 12:09 devlead