title: VS2017 ASP .NET Core Error when adding a Razor View
body: <p>When I right click on a folder Add->View to add a Razor View:</p>
  
  <p><a href="https://i.stack.imgur.com/zhhvR.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/zhhvR.png" alt="Add View Dialog"></a></p>
  
  <p>I get the following error:</p>
  
  <p><code>No executable found matching the command dotnet-aspnet-codegenerator</code></p>
  
  <p><a href="https://i.stack.imgur.com/yHELp.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/yHELp.png" alt="Error"></a></p>
  
  <p>From initial searches online, I've not found a solution.  I've had this working on some projects - but cannot figure how to resolve this!  I've reinstalled VS2017 but the problem still exists.</p>
  
  <p>I suspect it is something in the project.  I've tried readding the code generation related packages but still the problem exists.</p>
  
  <p>Here is my csproj Package and Tool references:</p>
  
  <pre><code>&lt;Project Sdk="Microsoft.NET.Sdk.Web"&gt;
  
      &lt;PropertyGroup&gt;
          &lt;TargetFramework&gt;net462&lt;/TargetFramework&gt;
          &lt;RuntimeIdentifier&gt;win7-x86&lt;/RuntimeIdentifier&gt;
      &lt;/PropertyGroup&gt;
  
      &lt;ItemGroup&gt;
          &lt;PackageReference Include="Microsoft.ApplicationInsights.AspNetCore" Version="2.0.0" /&gt;
          &lt;PackageReference Include="Microsoft.AspNetCore" Version="1.1.1" /&gt;
          &lt;PackageReference Include="Microsoft.AspNetCore.Authentication.Cookies" Version="1.1.1" /&gt;
          &lt;PackageReference Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version="1.1.1" /&gt;
          &lt;PackageReference Include="Microsoft.AspNetCore.Identity" Version="1.1.1" /&gt;
          &lt;PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="1.1.1" /&gt;
          &lt;PackageReference Include="Microsoft.AspNetCore.Mvc" Version="1.1.2" /&gt;
          &lt;PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="1.1.1" /&gt;
          &lt;PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="1.1.1" PrivateAssets="All" /&gt;
          &lt;PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="1.1.1" /&gt;
          &lt;PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer.Design" Version="1.1.1" PrivateAssets="All" /&gt;
          &lt;PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="1.1.0" /&gt;
          &lt;PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="1.1.1" /&gt;
          &lt;PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="1.1.1" /&gt;
          &lt;PackageReference Include="Microsoft.VisualStudio.Web.BrowserLink" Version="1.1.0" /&gt;
          &lt;PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="1.1.0" PrivateAssets="All" /&gt;
          &lt;PackageReference Include="SimpleInjector.Integration.AspNetCore.Mvc" Version="3.3.2" /&gt;
          &lt;PackageReference Include="Telerik.UI.for.AspNet.Core" Version="2017.1.223" /&gt;
      &lt;/ItemGroup&gt;
      &lt;ItemGroup&gt;
          &lt;DotNetCliToolReference Include="Microsoft.EntityFrameworkCore.Tools.DotNet" Version="1.0.0" /&gt;
          &lt;DotNetCliToolReference Include="Microsoft.Extensions.SecretManager.Tools" Version="1.0.0" /&gt;
          &lt;DotNetCliToolReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Tools" Version="1.0.0" /&gt;
      &lt;/ItemGroup&gt;
  </code></pre>
  
  <p>I have the same issue adding <code>Controllers</code> using right-click Add->Controller too, so this is not restricted to Razor Views.</p>
  
  <p>This does work from context menu Add->New Item...->MVC View Page or Add->New Item...->MVC Controller Class.</p>