Azure-Samples / Azure-Samples/active-directory-dotnet-desktop-msgraph-v2
Regression introduced by PR #97
- Dominant language
- PowerShell
- Stars
- 159
- Forks
- 107
- PR merge metrics
- No merged PRs in 30d
Description
#97 appears to have caused a regression. Selecting the "Use Preview Broker" option results in exception (example attached below). It looks like the _runtimes_ subdirectory tree with the _msalruntime.dll_ file is missing from the compiled output.
This seems like the same problem described by [WAM / Troubleshooting](https://github.com/AzureAD/microsoft-authentication-library-for-dotnet/wiki/wam#unable-to-load-dll-msalruntime-or-one-of-its-dependencies-the-specified-module-could-not-be-found-error-message) in the [MSAL.NET repo](https://github.com/AzureAD/microsoft-authentication-library-for-dotnet), but the error message is different.
Reverting back to 71cfce1b43bc159f45ec90ca9268875a7e467131 (prior to #97) fixes the problem.
```
Error Acquiring Token Silently:
MSAL.Desktop.4.51.0.0.MsalClientException:
ErrorCode: wam_runtime_init_failed
Microsoft.Identity.Client.MsalClientException: The type initializer for 'Microsoft.Identity.Client.NativeInterop.API' threw an exception. See https://aka.ms/msal-net-wam#troubleshooting ---> System.TypeInitializationException: The type initializer for 'Microsoft.Identity.Client.NativeInterop.API' threw an exception. ---> System.ComponentModel.Win32Exception: The operation completed successfully
at Microsoft.Identity.Client.NativeInterop.API..cctor()
--- End of inner exception stack trace ---
at Microsoft.Identity.Client.NativeInterop.Module.AddRef(String handleName)
at Microsoft.Identity.Client.NativeInterop.Core..ctor()
at Microsoft.Identity.Client.Broker.RuntimeBroker.<>c.<.cctor>b__24_0()
--- End of inner exception stack trace ---
at Microsoft.Identity.Client.Internal.Requests.Silent.SilentRequest.d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Identity.Client.Internal.Requests.RequestBase.d__12.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Identity.Client.ApiConfig.Executors.ClientApplicationBaseExecutor.d__2.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at active_directory_wpf_msgraph_v2.MainWindow.d__3.MoveNext() in C:\Proj\Azure samples\active-directory-dotnet-desktop-msgraph-v2\active-directory-wpf-msgraph-v2\MainWindow.xaml.cs:line 67
Inner Exception: System.TypeInitializationException: The type initializer for 'Microsoft.Identity.Client.NativeInterop.API' threw an exception. ---> System.ComponentModel.Win32Exception: The operation completed successfully
at Microsoft.Identity.Client.NativeInterop.API..cctor()
--- End of inner exception stack trace ---
at Microsoft.Identity.Client.NativeInterop.Module.AddRef(String handleName)
at Microsoft.Identity.Client.NativeInterop.Core..ctor()
at Microsoft.Identity.Client.Broker.RuntimeBroker.<>c.<.cctor>b__24_0()
```
Contributor guide
Assessment
This issue has not been assessed yet.