title: How to use StackExchange.Redis in a Blazor WebAssembly app?
body: <p>I tried to call <code>ConnectionMultiplexer.ConnectAsync</code> in a Blazor client-side component in the following way: </p>
  
  <pre><code>protected override async Task OnInitializedAsync()
  {
    var configuration = new ConfigurationOptions
    {
      AbortOnConnectFail = false,
      ConnectTimeout = 3000,
      SyncTimeout = 5000,
      KeepAlive = 180,
      EndPoints =
      {
        {
          "localhost", 6379
        }
      }
    };
  
    await ConnectionMultiplexer.ConnectAsync(configuration);
  
    await base.OnInitializedAsync();
  }
  </code></pre>
  
  <p>This throws an exception:</p>
  
  <blockquote>
    <p>children could not be evaluated</p>
  </blockquote>
  
  <p>How Is it possible to use <code>StackExchange.Redis</code> in a <code>Blazor WebAssembly</code> app? </p>
  
  <p><strong>Edit:</strong></p>
  
  <p>I found a more verbose error message in the VS output:</p>
  
  <blockquote>
  <pre><code>  Unhandled exception rendering component: Cannot start threads on this runtime.
  </code></pre>
    
    <p>System.NotSupportedException: Cannot start threads on this runtime.
      at (wrapper managed-to-native) System.Threading.Thread.Thread_internal(System.Threading.Thread,System.MulticastDelegate)
      at System.Threading.Thread.StartInternal (System.Object principal, System.Threading.StackCrawlMark&amp; stackMark) &lt;0x3b02590 + 0x00008> in :0 
      at System.Threading.Thread.Start (System.Threading.StackCrawlMark&amp; stackMark) &lt;0x3b02450 + 0x0004e> in :0 
      at System.Threading.Thread.Start (System.Object parameter) &lt;0x3b022d0 + 0x0003a> in :0 
      at Pipelines.Sockets.Unofficial.DedicatedThreadPoolPipeScheduler.StartWorker (System.Int32 id) [0x0003a] in C:\Code\Pipelines.Sockets.Unofficial\src\Pipelines.Sockets.Unofficial\DedicatedThreadPoolPipeScheduler.cs:112 
      at Pipelines.Sockets.Unofficial.DedicatedThreadPoolPipeScheduler..ctor (System.String name, System.Int32 workerCount, System.Int32 useThreadPoolQueueLength, System.Threading.ThreadPriority priority) [0x00072] in C:\Code\Pipelines.Sockets.Unofficial\src\Pipelines.Sockets.Unofficial\DedicatedThreadPoolPipeScheduler.cs:74 
      at StackExchange.Redis.SocketManager..ctor (System.String name, System.Int32 workerCount, StackExchange.Redis.SocketManager+SocketManagerOptions options) [0x0006e] in /<em>/src/StackExchange.Redis/SocketManager.cs:98 
      at StackExchange.Redis.SocketManager..ctor (System.String name, System.Int32 workerCount, System.Boolean useHighPrioritySocketThreads) [0x00000] in /</em>/src/StackExchange.Redis/SocketManager.cs:44 
      at StackExchange.Redis.SocketManager.get_Shared () [0x0000c] in /<em>/src/StackExchange.Redis/SocketManager.cs:132 
      at StackExchange.Redis.ConnectionMultiplexer.OnCreateReaderWriter (StackExchange.Redis.ConfigurationOptions configuration) [0x00000] in /</em>/src/StackExchange.Redis/ConnectionMultiplexer.ReaderWriter.cs:9 
      at StackExchange.Redis.ConnectionMultiplexer..ctor (StackExchange.Redis.ConfigurationOptions configuration) [0x000d6] in /<em>/src/StackExchange.Redis/ConnectionMultiplexer.cs:1150 
      at StackExchange.Redis.ConnectionMultiplexer.CreateMultiplexer (System.Object configuration, StackExchange.Redis.ConnectionMultiplexer+LogProxy log, System.EventHandler`1[StackExchange.Redis.ConnectionFailedEventArgs]&amp; connectHandler) [0x0000d] in /</em>/src/StackExchange.Redis/ConnectionMultiplexer.cs:957 
      at StackExchange.Redis.ConnectionMultiplexer.ConnectImplAsync (System.Object configuration, System.IO.TextWriter log) [0x0003a] in /_/src/StackExchange.Redis/ConnectionMultiplexer.cs:854 
      at Joker.BlazorApp.Sample.Pages.ProductsComponentBase.OnInitializedAsync () [0x0007c] in C:\Users\tomas.fabian\source\repos\Joker.BlazorApp.Sample\Joker.BlazorApp.Sample\Pages\ProductsComponentBase.cs:52 
      at Microsoft.AspNetCore.Components.ComponentBase.RunInitAndSetParametersAsync () &lt;0x37da140 + 0x0013a> in :0 </p>
  </blockquote>