Skip to content

In the case of CLI, current directory affect to read appsettings.json file. #403

@daisukenishino2

Description

@daisukenishino2

Requirement

In the case of the CLI, depending on the current directory, there possibility to occur problem with the path for read appsettings.json file. In Container, the current directory can be set to handle this, but in CLI, it can be executed in any current directory.

var dir = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);

↓ ↓ ↓

// configの初期化
string dir = new FileInfo(Assembly.GetExecutingAssembly().Location).Directory
    .FullName.Replace(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar);
GetConfigParameter.InitConfiguration(dir + "/appsettings.json");

Maybe you can execute with Linux-style path.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions