hi there,
am using the CLI version under Win2019 server, cause i don't have the desktop experience installed for 2019, so UI of naps2 will not work. i can't revert to desktop exp cause of constraints on this site. the naps2 console works fine, can see the printer, etc. but i get stack error about missing nlog extensions as following. have tried adding nlog manually but that is another can of worms since this is NOT a dev environment and i don't have time to build a custom fix. am wondering why does the naps2 deployment not work out of box, given i have right versions of .net installed, etc.
this scanner does not work with anything else, please help
error when running
C:\Program Files\NAPS2>naps2.console --device "Brother DCP-L2540DW series" -o "C:\users\XXX\scan.pdf" --driver wia --noprofile -v
Beginning scan...
Starting scan 1 of 1...
Unhandled Exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.AggregateException: One or more errors occurred. ---> System.MissingMethodException: Method not found: 'Void NLog.LogEventInfo..ctor(NLog.LogLevel, System.String, System.String, System.String, System.Collections.Generic.IList1<NLog.MessageTemplates.MessageTemplateParameter>)'.
at NLog.Extensions.Logging.NLogLogger.CaputureBasicLogEvent(LogLevel nLogLogLevel, String formattedMessage, IReadOnlyList
1 messageProperties, NLogMessageParameterList messageParameters)
at NLog.Extensions.Logging.NLogLogger.CreateLogEventInfoTState
at Microsoft.Extensions.Logging.LoggerExtensions.Log(ILogger logger, LogLevel logLevel, EventId eventId, Exception exception, String message, Object[] args)
at NAPS2.Logging.Log.FatalException(String message, Exception exception)
at NAPS2.Automation.AutomatedScanning.<execute>d__28.MoveNext()
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
at NAPS2.EntryPoints.ConsoleEntryPoint.Run(String[] args, Module imageModule)
--- End of inner exception stack trace ---
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at NAPS2.Console.Program.Main(String[] args)</execute>
CHECK DOTNOT:
C:\Program Files\NAPS2>dotnet --list-sdks
8.0.301 [C:\Program Files\dotnet\sdk]
CHECK NUGET
C:\Program Files\NAPS2>dotnet nuget list source
Registered Sources:
1. nuget.org [Enabled]
https://api.nuget.org/v3/index.json
D:\Tekoa\Brother Printers\naps2-7.4.2-win\App>naps2.console --listdevices --driver wia
Brother MFC-L5900DW series [3c2af45cf69d]
Brother DCP-T710W [1cbfc07f887f]
Brother DCP-L2540DW series [94ddf80d6bda]
Brother MFC-L5900DW series [b422009908a7]
The printer am trying to resolve wrt scanning:
Brother DCP-L2540DW series
TESTED IN OTHER WAYS?
It is scanning via scan profiles, if I do that via "Devices and printers"
...so device is installed fine, driver is there, etc.
My best guess is that your installation is broken (it can happen if you install both the .exe and .msi installers), try uninstalling and reinstalling NAPS2.
If that doesn't work, there's maaaybe a chance that an old version of NLog is installed in the GAC and causing conflicts. I'm not sure.