title: Error Acquring token for Azure AD B2C on native app (WPF) executable file
body: <p>I Have created an native app (WPF) where the authentication system is based on Azure AD B2C.
  I have been following the documentation here:</p>
  <p><a href="https://docs.microsoft.com/en-us/azure/active-directory-b2c/configure-authentication-sample-wpf-desktop-app" rel="nofollow noreferrer">Configure authentication in a sample WPF</a></p>
  <p><a href="https://docs.microsoft.com/en-us/azure/active-directory-b2c/quickstart-native-app-desktop" rel="nofollow noreferrer">WPF Sample</a></p>
  <p>And everything works...</p>
  <p>But when I create an <strong>executable file</strong> and install it on another machine the errors begin.</p>
  <p>Here is the error message:</p>
  <pre><code>Error Acquiring Token:
  System.InvalidOperationException: Sequence contains no elements
     at System.Linq.Enumerable.Max[TSource](IEnumerable`1 source)
     at Microsoft.Identity.Client.TokenCache.CalculateSuggestedCacheExpiry()
     at Microsoft.Identity.Client.TokenCache.&lt;Microsoft-Identity-Client-ITokenCacheInternal-SaveTokenResponseAsync&gt;d__59.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.Cache.CacheSessionManager.&lt;SaveTokenResponseAsync&gt;d__10.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.&lt;CacheTokenResponseAndCreateAuthenticationResultAsync&gt;d__16.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.InteractiveRequest.&lt;ExecuteAsync&gt;d__8.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.&lt;RunAsync&gt;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.PublicClientExecutor.&lt;ExecuteAsync&gt;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_b2c_wpf.MainWindow.&lt;SignInButton_Click&gt;d__1.MoveNext() in C:\Users\***\Desktop\active-directory-b2c-dotnet-desktop-msalv3\active-directory-b2c-wpf\MainWindow.xaml.cs:line 36 
  </code></pre>
  <p>So what am I doing wrong? And can anybody get the sample app working after they have created an executable file from it?</p>