dymosoftware / DCD-SDK-Sample

DYMO Connect SDK Samples
Other
60 stars 27 forks source link

Exception when getting printers #92

Open martijnburgers opened 8 months ago

martijnburgers commented 8 months ago

More than often we get the following exception within DYMO.WebApi.Win.Host.exe whenever we call /DYMO/DLS/Printing/GetPrinters which results in 500. But then a new call just returns the printers. So it's kind of transient. It goes and it comes.

Category: Microsoft.AspNetCore.Server.Kestrel EventId: 13 ConnectionId: 0HN166CP906VH RequestId: 0HN166CP906VH:0000000B RequestPath: /DYMO/DLS/Printing/GetPrinters SpanId: |23f51d08-4097aca6456b367e. TraceId: 23f51d08-4097aca6456b367e ParentId:

Connection id "0HN166CP906VH", Request id "0HN166CP906VH:0000000B": An unhandled exception was thrown by the application.

Exception: System.Exception: Error getting printers ---> System.NullReferenceException: Object reference not set to an instance of an object. at DYMO.LabelAPI.Windows.PrinterDiscovery.WindowsDeviceDiscoveryAgent.Stop() at DYMO.LabelAPI.PrinterFactory.RefreshPrinters() at DymoSDK.Implementations.DymoPrinter.GetPrinters() --- End of inner exception stack trace --- at DymoSDK.Implementations.DymoPrinter.GetPrinters() at DYMO.WebApi.Server.Controllers.DymoDLSSDKController.GetPrinters() at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.TaskOfIActionResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.gAwaited|12_0(ControllerActionInvoker invoker, ValueTask`1 actionResultValueTask) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeInnerFilterAsync() --- End of stack trace from previous location where exception was thrown --- at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.gAwaited|19_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.gLogged|17_1(ResourceInvoker invoker) at Microsoft.AspNetCore.Routing.EndpointMiddleware.g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger) at DYMO.WebApi.Server.Startup.<>c.<b5_0>d.MoveNext() --- End of stack trace from previous location where exception was thrown --- at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.ProcessRequests[TContext](IHttpApplication`1 application)

Thanks in advance,

Martijn