Closed deadmouse closed 2 years ago
I have got exact the same isseu with version ms-dynamics-smb.al-8.2.550913 with version ms-dynamics-smb.al-8.2.545335 it all works perfect.
New version is coming soon with this fix :)
We have this problem as well, what is the exact release date of dataverse connection bug free visual studio extension? ASAP please.
Version 8.2.552672 that is currently the latest available in VSC marketplace should have fixed the issue, please check.
Closing the issue, please reopen if you think the problem is still present on the latest version.
Sorry, this still seems to be a problem.
As you can see, AL extension version is 8.2.552672. The login dialogue comes up, enter admin user name, enter password, account requires MFA so ask for an SMS, SMS arrives, key in the code supplied and it fails.
PS C:\users\MyName.vscode\extensions\ms-dynamics-smb.al-8.2.552672\bin> .\altpgen.exe -project:"D:\Development\AL\ProjectName" -packagecachepath:"D:\Development\AL\ProjectName.alpackages" -serviceuri:"https://mycustomer-uat.crm11.dynamics.com" -entities:account,location -baseid:60000 -tabletype:CRM Microsoft (R) AL Table Proxy Generator version 8.2.8.28400 Copyright (C) Microsoft Corporation. All rights reserved
Authenticating Dataverse using ServiceUri=https://mycustomer-uat.crm11.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, Culture=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\Microsoft.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
Tried in Powershell 5 & 7, tried installing PS Azure AD module, ADAL.PS module, even tried dropping the correct DLL in the bin folder so that it is there to be found. Checked .NET framework is greater than 4.8 (which is what the altpgen.exe.config requires). All failed.
Tried it on a different customer that doesn't require MFA and which had worked on a previous version of altpgen and that failed the same way.
I've got a deadline to meet so I'm going to try handcrafting the tables, but please advise soonest. Thanks.
I am getting the same error as MajorBarf on AL extension version v8.2.552672
Microsoft (R) AL Table Proxy Generator version 8.2.8.28400 Copyright (C) Microsoft Corporation. All rights reserved
Authenticating Dataverse using ServiceUri=https://_XXXXX_.crm3.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, Culture=neutral, PublicKeyToken=XXXXXXXXX' 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\Microsoft.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
Indeed with version 8.2.552672 you have above problems when there is logged in.
I managed to get this working by switching to an older version. Here's what I did:
Thanks L-PDS, that works. It is rubbish that it has to be like that, but it works. :)
So in AL extension 7.1.453917 the altpgen.exe.config refers to Microsoft.IdentityModel.Clients.ActiveDirectory v3.13 and the bin folder contains that DLL, but it is v5.2.7.0. Then in AL extension 8.2.552672 the altpgen.exe.config refers to Microsoft.IdentityModel.Clients.ActiveDirectory v5.2.7.0 but that DLL is missing from the bin folder. However, it does have Microsoft.Identity.Client which allegedly is a newer replacement (according to https://www.nuget.org/packages/Microsoft.IdentityModel.Clients.ActiveDirectory/)
I did try getting the correct DLL & version, but dropping it into the bin folder didn't fix the problem. I think I restarted VS Code afterwards but can't be sure because I did so much trying to fix this yesterday.
I have created isseu https://github.com/microsoft/AL/issues/6866 for this isseu. So hopefully you don't need the work around.
1. Describe the bug Using altpgen.exe throws error in AL version 8.2.550913 but not in version 8.2.545335.
2. To Reproduce Steps to reproduce the behavior:
3. Expected behavior Download table .al files
4. Actual behavior Console throws this error:
muser -baseid:57600 -tabletype:CDS Microsoft (R) AL Table Proxy Generator version 8.2.8.26641 Copyright (C) Microsoft Corporation. All rights reserved
Authenticating Dataverse using ServiceUri=https://CLIENT.crm4.dynamics.com/ System.IO.FileLoadException: No se puede cargar el archivo o ensamblado 'Microsoft.Identity.Client, Version=4.7.1.0, Culture=neutral, PublicKeyToken=0a613f4dd989e8ae' ni una de sus dependencias. La definición del manifiesto del ensamblado no coincide con la referencia al ensamblado. (Excepción de HRESULT: 0x80131040) Nombre de archivo: 'Microsoft.Identity.Client, Version=4.7.1.0, Culture=neutral, PublicKeyToken=0a613f4dd989e8ae' en Microsoft.Dynamics.Nav.TableProxyGenerator.AzureADAuthenticationHelper..ctor(String clientId, String authority, String redirectUri, CompilerTextWriter compilerTextWriter) en Microsoft.Dynamics.Nav.TableProxyGenerator.TableProxyGeneratorTool.RunCore(CompilerTextWriter consoleOutput, ErrorLogger errorLogger, CancellationToken cancellationToken) en D:\a\1\s\source\Prod\Microsoft.Dynamics.Nav.TableProxyGenerator\TableProxyGeneratorTool.cs:línea 36 en Microsoft.Dynamics.Nav.CodeAnalysis.CompilationDependentTool.Run(CompilerTextWriter consoleOutput, ErrorLogger errorLogger, CancellationToken cancellationToken) en D:\a\1\s\source\Prod\Microsoft.Dynamics.Nav.TableProxyGenerator\CompilationDependentTool.cs:línea 125 en Microsoft.Dynamics.Nav.CodeAnalysis.CompilationDependentTool.Run(CompilerTextWriter consoleOutput, CancellationToken cancellationToken) en D:\a\1\s\source\Prod\Microsoft.Dynamics.Nav.TableProxyGenerator\CompilationDependentTool.cs:línea 77 en Microsoft.Dynamics.Nav.TableProxyGenerator.TableProxyGeneratorCommandLineTool.Run(String clientDirectory, String baseDirectory, String[] args)
AVS: El registro del enlace de ensamblado está desactivado. Para habilitar el registro de errores del enlace de ensamblado, establezca el valor de Registro [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) como 1. Nota: existe una disminución del rendimiento asociada registro de errores del enlace de ensamblado. Para desactivar esta característica, elimine el valor de Registro [HKLM\Software\Microsoft\Fusion!EnableLog].
5. Versions:
Final Checklist
Please remember to do the following:
[X] Search the issue repository to ensure you are reporting a new issue
[X] Reproduce the issue after disabling all extensions except the AL Language extension
[X] Simplify your code around the issue to better isolate the problem