"Invalid Token" using NLog.Mongo in .Net Core
Upon using the NLog.Mongo in .Net Core Class Library and use it as a reference in a console app it returns the "Invalid Token".
The solution is just the same as what you can see here in the Console test App and setup is just the same.
But when you use this in a .Net Framework Class Library it returns fine.

"Invalid Token" is returned from MongoDb. Do you have an NLog.config or other example of how you configure the NLog Target?
Have you checked the NLog InternalLogger for clues?
@snakefoot
I generate the log using the internal logging please see the generated log below:

Also below is the sample Nlog.config that is being used:
<?xml version="1.0" encoding="utf-8" ?>
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
autoReload="true"
throwExceptions="true"
internalLogLevel="Trace" internalLogFile="c:\temp\nlog-internal.log">
<!-- enable mongodb layout renderers -->
<extensions>
<add assembly="NLog.WindowsIdentity"/>
<add assembly="NLog.Mongo"/>
</extensions>
<targets>
<!-- write log to mongodb-->
<target xsi:type="Mongo"
name="mongo" databaseName="TestLog"
collectionName="Logs"
connectionString="mongodb://localhost/TestLog"
IncludeDefaults="false"
>
<Field name="LongDate" layout="${longdate}" bsonType="DateTime" />
<Field name="Level" layout="${level}" />
<Field name="Logger" layout="${logger}"/>
<Field name="Message" layout="${message}" />
<Field name="Exception" layout="${exception:format=tostring}" />
<Field name="CallSite" layout="${callsite:filename=true}"/>
<Field name="StackTrace" layout="${stacktrace}"/>
</target>
</targets>
<rules>
<!-- add your logging rules here -->
<logger name="*" minlevel="Trace" writeTo="mongo"/>
</rules>
</nlog>
Googled it for you, and this came up:
https://stackoverflow.com/questions/5334661/system-badimageformatexception-invalid-token-when-updating-dll-to-newest-versi