Skip to content

AddCarter failes if project is published as single file #383

Description

@marchutten

If the project is published as single file

  <PublishSingleFile>true</PublishSingleFile>
  <PublishTrimmed>false</PublishTrimmed>
  <RuntimeIdentifier>win-x64</RuntimeIdentifier>

the services.AddCarter() fails.

In the class DependencyContextAssemblyCatalog the method 'GetAssemblies' fails. due to the fact that the 'this.dependencyContext == null'
A check for null will solve this issue

the explicit use of ICsarterModules is now required:

builder.Services.AddCarter();
builder.Services.AddTransient<ICarterModule, ActorsModule>();
builder.Services.AddTransient<ICarterModule, ...>();

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions