Skip to content

Admin app DI error when not setup #53

@vallieresc

Description

@vallieresc

If the AppText.AdminApp reference is added but no .AddAdmin() is set the result is InvalidOperationException: Unable to resolve service for type 'AppText.AdminApp.Configuration.AppTextAdminConfigurationOptions' while attempting to activate 'AppText.AdminApp.Controllers.AdminController'.

My setup has options in the appsettings file for the dev to disable the admin feature in their environment so it would be great to be able to disable admin for security reasons. Not sure what the best approach would be for this? Removing the Admin package is a way but when releasing the app in other environments it's not great. A quick appsettings change would be ideal for us = no .AddAdmin() set or .AddAdmin(o => o.Enable = false).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions