In Dynamics 365 Business Central v160 (16.5) we use OAUTH 2.0 as connection protocol instead of previous legacy protocols. After adding consent to the Azure AD app so that the solution can be injected to CDS, an error may be shown to the user and an event is written in the application event log file.
Application event log file:
Server instance: BC160
Category: Runtime
ClientSessionId: ed651d76-4dfc-41dc-804d-e96cff845704
ClientActivityId: 87f46331-46b0-4079-9c8b-10158b32d51c
ServerSessionUniqueId: 3cbfde90-7a7c-4e6a-8923-7c96b358f888
ServerActivityId: 9042176b-76ec-4ab3-961d-7f57318fa56a
EventTime: 09/25/2020 13:48:39
Message (NavNCLDialogException): This message had personal data removed. The original may still be in transient telemetry. Find it using the transientTelemetryId.
ParentException: NavNCLDialogException
Failed to acquire an access token for %1.
A workaround does exist. Download the following package from https://www.nuget.org/packages/Microsoft.Identity.Client/4.14.0. Extract the files and from \lib\net45, copy the following files to the Service folder of the NST (%programfiles%\Microsoft Dynamics 365 Business Central\160\Service).
Microsoft.Identity.Client.dll
Microsoft.Identity.Client.xml
NOTE: we expect version 14.0, a higher version will not work with 16.5.
Restart the NST. After that, that specific error will no longer occur and the CDS connection can be enabled or redeployed.
Thanks.