kdcllc / CometD.NetCore.Salesforce

CometD Salesforce Implementation.
MIT License
45 stars 24 forks source link

[AuthApp] An error occurred while writing to logger(s) #28

Closed ianrandell-sh closed 1 year ago

ianrandell-sh commented 3 years ago

Hi there. Thanks for this great repo. Hopefully it'll do exactly what I want. At the moment though, I am stuck trying to use the AuthApp tool. If I add an appsettings.json and compile the project, then run it from the bin folder, I get: An error occurred while writing to logger(s). (Index (zero based) must be greater than or equal to zero and less than the size of the argument list.) Same if I F5 it in VS 2019.

The (redacted) command line I'm running (from a vs code ps terminal) is:

.\AuthApp.exe get-tokens --key:3M... ...r7 --secret:A8... ...CA --verbose:debug --section:Salesforce

appsettings.json (redacted) looks like:

{
  "AzureVault": {
    "BaseUrl": null
  },
  "Salesforce": {
    "ClientId": "3M... ....r7",
    "ClientSecret": "A8... ...CA",
    "RefreshToken": "",
    "AccessToken": "",
    "RedirectUri": "http://localhost:5050/",
    "OrganizationUrl": "",
    "LoginUrl": "https://login.salesforce.com",
    "OAuthUri": "/services/oauth2/token",
    "PublishEndpoint": "/services/data/v42.0/sobjects/",
    "EventOrTopicUri": "/event",
    "CometDUri": "/cometd/42.0",
    "Retry": 2,
    "CustomEvent": "Custom_Event__e",
    "ReplayId": "-2"
  }
}

Top half of the stacktrace:

   at Microsoft.Extensions.Logging.Logger.ThrowLoggingError(List`1 exceptions)
   at Microsoft.Extensions.Logging.Logger.Log[TState](LogLevel logLevel, EventId eventId, TState state, Exception exception, Func`3 formatter)
   at Microsoft.Extensions.Logging.Logger`1.Microsoft.Extensions.Logging.ILogger.Log[TState](LogLevel logLevel, EventId eventId, TState state, Exception exception, Func`3 formatter)
   at Microsoft.Extensions.Logging.LoggerExtensions.Log(ILogger logger, LogLevel logLevel, EventId eventId, Exception exception, String message, Object[] args)
   at Microsoft.Extensions.Hosting.HostStartupService.StartAsync(CancellationToken cancellationToken) in C:\projects\bet-aspnetcore\src\Bet.Extensions.Hosting\HostStartupService.cs:line 43
   at Microsoft.Extensions.Hosting.Internal.Host.<StartAsync>d__9.MoveNext()

I have security issues trying to run the "dotnet tool install" command which is why Im using the source code.

Any help greatly appreciated

ianrandell-sh commented 3 years ago

This only seems to happen when "--verbose:debug" Using "--verbose:information" instead appears to work fine