title: .Net Core CLI tool not available in Visual Studio Mac
body: <p>tl;dr - custom .Net Core CLI tool not found when running as a pre-build step in Visual Studio Mac.</p>
  
  <p>Full Story -</p>
  
  <p>I have developed a custom .Net Core CLI tool, let's call it <code>ConfigTool</code>. This tool was developed as a .Net Core console application, and was deployed as a nuget package in a private repository.</p>
  
  <p>I have a .Net Core 2.0 project that references the nuget/tool in the <code>csproj</code> as follows:</p>
  
  <p><code>&lt;ItemGroup&gt;
      &lt;DotNetCliToolReference Include="My.Namespace.ConfigTool" Version="1.0.0" /&gt;
  &lt;/ItemGroup&gt;</code></p>
  
  <p>When building the project, it restores the nuget package, and makes the CLI tool available as <code>dotnet-configtool</code>. If I open up the terminal and navigate to my project directory and run the command <code>dotnet configtool</code> it works as expected.</p>
  
  <p>Now, I want this command to run as part of the build process. So, I added the following to the bottom of my <code>csproj</code>.</p>
  
  <p><code>&lt;Target Name="PreBuild" BeforeTargets="PreBuildEvent"&gt;
      &lt;Exec Command="dotnet configtool" /&gt;
   &lt;/Target&gt;</code></p>
  
  <p><strong>Problem</strong>:
  When building the project from within Visual Studio Mac (Community Edition), I get the following error: <code>No executable found matching command "dotnet-configtool"</code>.</p>
  
  <p><strong>Things tried</strong></p>
  
  <ol>
  <li>Ran <code>dotnet configtool</code> from terminal in the project directory (windows). <strong>Success</strong>.</li>
  <li>Ran <code>dotnet configtool</code> as a pre-build step in Visual Studio 2017 (windows). <strong>Success</strong>.</li>
  <li>Ran <code>dotnet configtool</code> from terminal in the project directory (mac). <strong>Success</strong>.</li>
  <li>Ran <code>dotnet build</code> from terminal in the project directory (mac). <strong>Success</strong></li>
  <li>Ran <code>dotnet configtool</code> as a pre-build step in Visual Studio Mac (community edition) (mac). <strong>FAILED</strong>.</li>
  </ol>
  
  <p>I need this to work when running the solution from Visual Studio Mac.</p>
  
  <p>Any ideas?</p>