I'm migrating a bot from MS Botframework 3 to 4. We had a function that would email various individuals daily. Moving the code to v4 appears valid, but the call returns an error from inside the framework.
The exception is thrown in the Microsoft.Bot.Connector.Authentication namespace, in the method MicrosoftAppCredentials(string appId, string password, HttpClient customHttpClient). The error is System.ArgumentNullException: 'Value cannot be null. Parameter name: clientId'. customHttpClient inside that method is null. I do not see a way to pass along an HttpClient. Maybe my implementation is wrong?
My code:
ChannelAccount userAccount = new ChannelAccount(_config.UncategorizedReportToEmail, _config.UncategorizedReportToEmail);
var botAccount = new ChannelAccount(_config.BotEmail, _config.BotEmail);
var connector = new ConnectorClient(new Uri(_config.EmailServiceUrl));
MicrosoftAppCredentials.TrustServiceUrl(_config.EmailServiceUrl);
// Next line is where the exception is thrown
var conversation = connector.Conversations.CreateDirectConversation(botAccount, userAccount);
var conversationId = conversation.Id;