Base solution for your next web application
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.

Markdown is supported
Copy & paste or drag & drop images (max 30 MB per image)

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

    Markdown is supported
    Copy & paste or drag & drop images (max 30 MB per image)
  • 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!

    Markdown is supported
    Copy & paste or drag & drop images (max 30 MB per image)