Base solution for your next web application
Starts in:
01 DAYS
01 HRS
01 MIN
01 SEC
Open Closed

Migrator Multiple appsettings.json files #6110


User avatar
0
cyklussoftware created

The Web.Host project has the ability to use multiple appsettings.json files based on the ASPNETCORE_ENVIRONMENT environment variable. Would it be possible to have multiple appsettings.json files for the Migrator application like the Web.Host project has? I tried looking into this sort of functionality through separate files and separate entries in the single appsettings.json file, but the Migrator application ONLY uses the Default connection from the appsettings.json file.

If you could point me in the correct direction, that would be great.


2 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @cyklussoftware

    ASP.NET Core provides this functionality out of the box. If you want to implement such a thing for Migrator, you can get a parameter from args of colsole app and choose the correct setting file using it.

    You can also create a feature reuqest here https://github.com/aspnetzero/aspnet-zero-core/issues

  • User Avatar
    0
    cyklussoftware created

    I got it working. I guess I overlooked the AppConfigurations.Get() method in the MigratorModule the first time I tried this. Now I just pass the name of my environment to that method and it works great.

    Thanks!