web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Suggested Answer

BC Integration with Dataverse - altpgen failing

(0) ShareShare
ReportReport
Posted on by 429

Hi, 

I am trying to set up the integration between BC and Dataverse - I ran the initial setup from the Assisted Setup and looks good. I would like to extend and customize the integration using the AL Table Proxy Generator (altpgen) as explained in this MS Documentation; 

https://docs.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/devenv-al-table-proxy-generator

however as soon as I run the altpgen command, it asks me to authenticate which I do but then fails as per below error in powershell; 

Authenticating Dataverse using ServiceUri=https://orgxxxxxxxx.crm.dynamics.com/
error CDS0001: Error connecting to Dataverse.
Microsoft.Dynamics.Nav.Xrm.Common.XrmException: Could not load file or assembly 'Microsoft.IdentityModel.Clients.ActiveDirectory, Version=5.2.7.0, Cultu
re=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.

Server stack trace:
Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at Microsoft.Dynamics.Nav.Xrm.Common.IXrmService.Connect(String serviceUri, String token)
at Microsoft.Dynamics.Nav.TableProxyGenerator.XrmMetadataService.CreateXmlMetadataService(String serviceUri, String token) in D:\a\1\s\source\Prod\Mi
crosoft.Dynamics.Nav.TableProxyGenerator\Xrm\XrmMetadataService.cs:line 67
at Microsoft.Dynamics.Nav.TableProxyGenerator.TableProxyGeneratorTool.CreateXrmMetadataService(IList`1 diagnostics, String token) in D:\a\1\s\source\
Prod\Microsoft.Dynamics.Nav.TableProxyGenerator\TableProxyGeneratorTool.cs:line 84

This is using BC SaaS and the AL Extension in VS Code is updated to the latest too. 

Any idea what could be the issue here, please? 

Thanks in advance!

I have the same question (0)
  • Suggested answer
    YUN ZHU Profile Picture
    98,233 Super User 2026 Season 1 on at

    Hi, I tested in previous version, hope the following will help.

    https://yzhums.com/17065/

    Thanks.

    ZHU

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,055 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 1,063 Super User 2026 Season 1

#3
Dhiren Nagar Profile Picture

Dhiren Nagar 1,014 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans