Skip to content

Calling AddAppFromType before AddAppsFromAssembly only discovers the app in the first call #620

@BeeHiveJava

Description

@BeeHiveJava

The problem

Whenever I setup my project, and I somewhere end up calling AddAppFromType before I call AddAppsFromAssembly, it will only resolve the app specified in AddAppFromType. This is probably because this code checks whether there already is an IAppResolver registered. And there is, because AddAppFromType adds a SingleAppResolver. This now fails to add the required AppTypeResolver, which uses the registered IAssemblyResolver.

Environment

  • NetDaemon release with the issue: 22.3.0
  • Last working NetDaemon release (if known): -
  • Operating environment (Home assistant Add-on/Docker/Dev setup): Docker / Dev
  • Link to integration documentation on our website:

Link to or paste code that causes the issue

    public static IServiceCollection AddAppDeps(this IServiceCollection services) =>
        services
            .AddAppFromType(typeof(<AppType>))
    public static IServiceCollection AddAssemblyDeps(this IServiceCollection services) =>
        services
            .AddAppsFromAssembly(typeof(<AppType>).Assembly);

Traceback/Error logs

Additional information

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions