title: The type or namespace name "IJSRuntime" could not be found
body: <p>In my Blazor serverside application, I am trying to inject JSRuntime according to this documentation: <a href="https://blazor-university.com/javascript-interop/calling-javascript-from-dotnet/" rel="nofollow noreferrer">https://blazor-university.com/javascript-interop/calling-javascript-from-dotnet/</a></p>
  <p>To add JSRuntime to my project, I've added the following line in the ConfigureServices function of the Startup.cs file:</p>
  <pre><code>services.AddSingleton&lt;IJSRuntime, JSRuntime&gt;();
  </code></pre>
  <p>At the top of my razor page, I have the following:</p>
  <pre><code>@inject IJSRuntime JSRuntime
  </code></pre>
  <p>When I try to compile, it gives an error at this injection with the message &quot;The type or namespace name &quot;IJSRuntime&quot; could not be found (are you missing a using directive or an assembly reference?)&quot;</p>
  <p>I've tried enabling &quot;Use previews of the .NET SDK&quot; as per stackoverflow suggestions, but it didn't help.</p>