Skip to content

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

@devlead

Description

@devlead

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions