title: Microsoft.VisualStudio.Web.CodeGeneration.Design not being found by the dotnet aspnet-codegenerator tool
body: <p>I just created an MVC app with <code>dotnet new mvc --name test-project</code> (<code>netcoreapp3.1</code>), without any kind of database access and Identity, which I would like to add by hand for customisation purposes. Then I added some packages in order to use the <code>dotnet aspnet-codegenerator</code> tool. My <code>.csproj</code> looks like this:</p>
  <pre><code>&lt;Project Sdk=&quot;Microsoft.NET.Sdk.Web&quot;&gt;
  
    &lt;PropertyGroup&gt;
      &lt;TargetFramework&gt;netcoreapp3.1&lt;/TargetFramework&gt;
      &lt;RootNamespace&gt;test_project&lt;/RootNamespace&gt;
    &lt;/PropertyGroup&gt;
  
    &lt;ItemGroup&gt;
      &lt;PackageReference Include=&quot;Microsoft.VisualStudio.Web.CodeGeneration.Design&quot; Version=&quot;3.1.4&quot; /&gt;
      &lt;PackageReference Include=&quot;Microsoft.AspNetCore.Identity.EntityFrameworkCore&quot; Version=&quot;3.1.7&quot; /&gt;
      &lt;PackageReference Include=&quot;Microsoft.AspNetCore.Identity.UI&quot; Version=&quot;3.1.7&quot; /&gt;
      &lt;PackageReference Include=&quot;Microsoft.EntityFrameworkCore&quot; Version=&quot;3.1.7&quot; /&gt;
      &lt;PackageReference Include=&quot;Microsoft.EntityFrameworkCore.Design&quot; Version=&quot;3.1.7&quot;&gt;
        &lt;IncludeAssets&gt;runtime; build; native; contentfiles; analyzers; buildtransitive&lt;/IncludeAssets&gt;
        &lt;PrivateAssets&gt;all&lt;/PrivateAssets&gt;
      &lt;/PackageReference&gt;
      &lt;PackageReference Include=&quot;Microsoft.EntityFrameworkCore.Tools&quot; Version=&quot;3.1.7&quot;&gt;
        &lt;IncludeAssets&gt;runtime; build; native; contentfiles; analyzers; buildtransitive&lt;/IncludeAssets&gt;
        &lt;PrivateAssets&gt;all&lt;/PrivateAssets&gt;
      &lt;/PackageReference&gt;
      &lt;PackageReference Include=&quot;Newtonsoft.Json&quot; Version=&quot;12.0.3&quot; /&gt;
      &lt;PackageReference Include=&quot;Npgsql.EntityFrameworkCore.PostgreSQL&quot; Version=&quot;3.1.4&quot; /&gt;
      &lt;PackageReference Include=&quot;Npgsql.EntityFrameworkCore.PostgreSQL.Design&quot; Version=&quot;1.1.0&quot; /&gt;
    &lt;/ItemGroup&gt;
  &lt;/Project&gt;
  </code></pre>
  <p>As you can see, the <code>Microsoft.VisualStudio.Web.CodeGeneration.Design</code> is the first in the list. However, when I try to run any scaffolder from the <code>dotnet aspnet-codegenerator</code> tool (e.g.: <code>dotnet aspnet-codegenerator identity -h</code>), I get the following message:</p>
  <p><code>No code generators are available in this project.Add Microsoft.VisualStudio.Web.CodeGeneration.Design package to the project as a NuGet package reference.</code></p>
  <p>Even if I specify the <code>.csproj</code> file with the <code>-p</code> flag, I still get the same message.
  While doing some research, I found <a href="https://github.com/dotnet/Scaffolding/issues/1214" rel="nofollow noreferrer">this</a> Issue on their repo, but it's a different thing: the OP was trying to add the scaffolder to a .NET Core App 3.0 using the 3.1 scaffolder version.</p>
  <p>I'm using dotnet 3.1.401 on Xubuntu 20.04.</p>
  <p>Any thoughts? Thank you in advance.</p>
  <p><strong>EDIT 1</strong>
  Some people suggested this would be close to what we have <a href="https://stackoverflow.com/questions/58496125">here</a>, but the thing is: I know what it does and I actually added the &quot;global tools&quot; suggested in that article. The problem is the <code>aspnet-codegenerator</code> is not detecting that I already have the library it needs to its things, added to the <code>.csproj</code> file.</p>
  <p><strong>EDIT 1</strong></p>
  <p>Apparently, there's a couple of people facing this issue as well, so, I filed an <a href="https://github.com/dotnet/Scaffolding/issues/1393" rel="nofollow noreferrer">issue</a> on their repo</p>