如何解决:找不到与命令“ dotnet-dslc”匹配的可执行文件?

时间:2019-06-01 16:55:12

标签: c# .net macos visual-studio

我正在为我的论文进行文献调查,并尝试使用Microsoft的PROSE SDK。但是,每当我尝试从其样本[repo](https://github.com/microsoft/prose)构建项目的依赖项时,都会出现此错误:

<div class="column">
  <button id="change-color" data-status="on" onclick="changeColor()">Change Color</button>
</div>

我遵循了here

中的安装说明

以下是有关dotnet配置的信息:

macOS:High Sierra版本10.13.6 Visual Studio 2019 for Mac版本8.0.9 Target CompileGrammar: dotnet dslc "@/Users/username/test/prose/ProgramSynthesis/ProseSample.Substrings/obj/ProseSample.Substrings.rsp" dotnet dslc "@/Users/username/test/prose/ProgramSynthesis/ProseSample.Substrings/obj/ProseSample.Substrings.rsp" No executable found matching command "dotnet-dslc"

dotnet --info

这是.csproj文件:

.NET Core SDK (reflecting any global.json): Version: 2.2.106 Commit: aa79b139a8 Runtime Environment: OS Name: Mac OS X OS Version: 10.13 OS Platform: Darwin RID: osx.10.13-x64 Base Path: /usr/local/share/dotnet/sdk/2.2.106/ Host (useful for support): Version: 2.2.4 Commit: f95848e524 .NET Core SDKs installed: 2.2.105 [/usr/local/share/dotnet/sdk] 2.2.106 [/usr/local/share/dotnet/sdk] .NET Core runtimes installed: Microsoft.AspNetCore.All 2.2.3 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.All] Microsoft.AspNetCore.All 2.2.4 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.All] Microsoft.AspNetCore.App 2.2.3 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 2.2.4 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.NETCore.App 2.2.3 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App] Microsoft.NETCore.App 2.2.4 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]

ProseSample.Substrings.csproj

构建输出:

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <TargetFramework>net45</TargetFramework>
  </PropertyGroup>

  <ItemGroup>
    <ProjectReference Include="..\ProseSample.Substrings.Semantics\ProseSample.Substrings.Semantics.csproj" />
    <PackageReference Include="Microsoft.ProgramSynthesis.Common" Version="6.20.0" />
    <PackageReference Include="Microsoft.ProgramSynthesis.DslcTargets" Version="6.20.0" />
    <DotNetCliToolReference Include="Microsoft.ProgramSynthesis.Dslc" Version="6.20.0" />
  </ItemGroup>

</Project>

提前谢谢!

1 个答案:

答案 0 :(得分:0)

使用最新的PROSE v7.11.1和以下步骤,该构建现在似乎可以在macOS上通过。

您的环境中的dotnet dslc工具failing to run引发了构建失败。

首先,该工具似乎是需要安装的NuGet软件包的一部分

$ cd ProseSample
$ dotnet add package Microsoft.ProgramSynthesis.Dslc --version 7.11.1

接下来,看来运行该工具负责DSL代码生成的强制步骤的跨平台方式有所不同-dotnet run dslc

$ dotnet run dslc
$ dotnet build

Build succeeded.
    0 Warning(s)
    0 Error(s)

我想为了使构建能够在IDE中工作,还必须编辑~.nuget/packages/microsoft.programsynthesis.dslctargets/7.11.1/build/Microsoft.ProgramSynthesis.DslcTargets.targets并用dotnet dslc替换所有出现的两个dotnet run dslc

希望这会有所帮助!