4

tl;dr - custom .Net Core CLI tool not found when running as a pre-build step in Visual Studio Mac.

Full Story -

I have developed a custom .Net Core CLI tool, let's call it ConfigTool. This tool was developed as a .Net Core console application, and was deployed as a nuget package in a private repository.

I have a .Net Core 2.0 project that references the nuget/tool in the csproj as follows:

<ItemGroup> <DotNetCliToolReference Include="My.Namespace.ConfigTool" Version="1.0.0" /> </ItemGroup>

When building the project, it restores the nuget package, and makes the CLI tool available as dotnet-configtool. If I open up the terminal and navigate to my project directory and run the command dotnet configtool it works as expected.

Now, I want this command to run as part of the build process. So, I added the following to the bottom of my csproj.

<Target Name="PreBuild" BeforeTargets="PreBuildEvent"> <Exec Command="dotnet configtool" /> </Target>

Problem: When building the project from within Visual Studio Mac (Community Edition), I get the following error: No executable found matching command "dotnet-configtool".

Things tried

  1. Ran dotnet configtool from terminal in the project directory (windows). Success.
  2. Ran dotnet configtool as a pre-build step in Visual Studio 2017 (windows). Success.
  3. Ran dotnet configtool from terminal in the project directory (mac). Success.
  4. Ran dotnet build from terminal in the project directory (mac). Success
  5. Ran dotnet configtool as a pre-build step in Visual Studio Mac (community edition) (mac). FAILED.

I need this to work when running the solution from Visual Studio Mac.

Any ideas?

e.beyer
  • 173
  • 2
  • 12
  • Report the issue to Microsoft visual Help menu. – Lex Li Feb 08 '18 at 03:40
  • 2
    This is a known bug https://bugzilla.xamarin.com/show_bug.cgi?id=58925 and also reported on dev community - https://developercommunity.visualstudio.com/content/problem/59795/aspnet-core-bundle-minification-not-working.html – Matt Ward Feb 08 '18 at 12:29
  • Thank you, @MattWard! Can't believe I didn't find those reports in all my searching. – e.beyer Feb 09 '18 at 03:09

0 Answers0