Unable to resolve service for type 'Microsoft.Extensions.Logging.ILogger' while attempting
Unable to resolve service for type 'Microsoft.Extensions.Logging.ILogger' while attempting to activate 'xxxx'.
构造注入时需要加入类名
public class DeviceStateCommand : IAsyncCommand{ private readonly ILogger _logger; public DeviceStateCommand(ILogger logger) { _logger = logger; } }