title: Blazor WebAssembly App in .NET 5.0 with MatBlazor 2.8.0 - Cannot provide a value for property 'PortalService' on type 'MatBlazor.MatPortalHost'
body: <p>I have followed the installation instructions from <a href="https://www.matblazor.com/" rel="nofollow noreferrer">https://www.matblazor.com/</a>.</p>
  <p>1.Add @using MatBlazor in main _Imports.razor</p>
  <pre><code>@using MatBlazor
  </code></pre>
  <p>2.Add script section to index.html (head section)</p>
  <pre><code>&lt;script src=&quot;_content/MatBlazor/dist/matBlazor.js&quot;&gt;&lt;/script&gt;
  &lt;link href=&quot;_content/MatBlazor/dist/matBlazor.css&quot; rel=&quot;stylesheet&quot; /&gt;
  </code></pre>
  <p>3.Add registration of service to Startup.cs</p>
  <pre><code>services.AddMatBlazor();
  </code></pre>
  <p>4.Add MatPortalHost component to root component (App.razor) for some services like MatDialogService, MatPortalService</p>
  <pre><code>&lt;MatPortalHost&gt;&lt;/MatPortalHost&gt;
  </code></pre>
  <p>Error when starting:</p>
  <blockquote>
  <p>crit:
  Microsoft.AspNetCore.Components.WebAssembly.Rendering.WebAssemblyRenderer[100]
  Unhandled exception rendering component: Cannot provide a value for property 'PortalService' on type 'MatBlazor.MatPortalHost'. There
  is no registered service of type 'MatBlazor.IMatPortalService'.
  System.InvalidOperationException: Cannot provide a value for property
  'PortalService' on type 'MatBlazor.MatPortalHost'. There is no
  registered service of type 'MatBlazor.IMatPortalService'.</p>
  </blockquote>