Closed derekforeman closed 4 years ago
Exception has occurred: CLR/Twilio.Exceptions.AuthenticationException
An exception of type 'Twilio.Exceptions.AuthenticationException' occurred in Twilio.dll but was not handled in user code: 'Username can not be null'
at Twilio.TwilioClient.SetUsername(String username)
at Twilio.TwilioClient.Init(String username, String password)
at IEvangelist.VideoChat.Services.VideoService..ctor(IOptions1 twilioOptions) in /Users/dforeman/Projects/IEvangelist.VideoChat/Services/VideoService.cs:line 27 at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor, Boolean wrapExceptions) at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, RuntimeResolverContext context) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor
2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitDisposeCache(ServiceCallSite transientCallSite, RuntimeResolverContext context)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(ServiceCallSite callSite, TArgument argument)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.Resolve(ServiceCallSite callSite, ServiceProviderEngineScope scope)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.DynamicServiceProviderEngine.<>cDisplayClass1_0.
This is related to the _twilioSettings.ApiKey
not being set. You could set that as an environment variable or in the appsettings.json.
handled in user code: 'Username can not be null'
at Twilio.TwilioClient.SetUsername(String username)
at Twilio.TwilioClient.Init(String username, String password)
ENV was development, but had settings in app settings.json. I'll have another look. Thank you.
Hello,
I haven't dug into it yet, but the sample errors on run with the following stack. Node v10 .Net Core 3