首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何修复:找不到匹配命令"dotnet-dslc“的可执行文件?

如何修复:找不到匹配命令"dotnet-dslc“的可执行文件?
EN

Stack Overflow用户
提问于 2019-06-02 00:55:12
回答 1查看 422关注 0票数 2

我正在为我的论文进行文献调查,并尝试使用Microsoft的PROSE SDK。但是,每当我试图从他们的示例repo构建项目的依赖项时,我都会得到这样的错误:

代码语言:javascript
复制
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"

我按照here提供的安装说明操作

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

macOS: High Sierra Version 10.13.6 Visual Studio 2019 for Mac version 8.0.9 dotnet --info

代码语言:javascript
复制
.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]

下面是.csproj文件:

ProseSample.Substrings.csproj

代码语言:javascript
复制
<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>

构建输出:

代码语言:javascript
复制
Building ProseSample (Debug)
Build started 6/1/2019 5:53:06 PM.
__________________________________________________
Project "/Users/username/test/prose/ProgramSynthesis/ProseSample.Substrings.Semantics/ProseSample.Substrings.Semantics.csproj" (Build target(s)):

Target GenerateTargetFrameworkMonikerAttribute:
  Skipping target "GenerateTargetFrameworkMonikerAttribute" because all output files are up-to-date with respect to the input files.
Target CoreGenerateAssemblyInfo:
  Skipping target "CoreGenerateAssemblyInfo" because all output files are up-to-date with respect to the input files.
Target CoreCompile:
  Skipping target "CoreCompile" because all output files are up-to-date with respect to the input files.
Target _CopyFilesMarkedCopyLocal:
    Touching "/Users/username/test/prose/ProgramSynthesis/ProseSample.Substrings.Semantics/obj/Debug/net45/ProseSample.Substrings.Semantics.csproj.CopyComplete".
Target CopyFilesToOutputDirectory:
    ProseSample.Substrings.Semantics -> /Users/username/test/prose/ProgramSynthesis/ProseSample.Substrings.Semantics/bin/Debug/net45/ProseSample.Substrings.Semantics.dll
__________________________________________________
Project "/Users/username/test/prose/ProgramSynthesis/ProseSample.Substrings/ProseSample.Substrings.csproj" (Build target(s)):

Target _GetProjectReferenceTargetFrameworkProperties:
    __________________________________________________
    Project "/Users/username/test/prose/ProgramSynthesis/ProseSample.Substrings/ProseSample.Substrings.csproj" is building "/Users/username/test/prose/ProgramSynthesis/ProseSample.Substrings.Semantics/ProseSample.Substrings.Semantics.csproj" (GetTargetFrameworks target(s)):

Target ResolveProjectReferences:
    __________________________________________________
    Project "/Users/username/test/prose/ProgramSynthesis/ProseSample.Substrings/ProseSample.Substrings.csproj" is building "/Users/username/test/prose/ProgramSynthesis/ProseSample.Substrings.Semantics/ProseSample.Substrings.Semantics.csproj" (GetTargetPath target(s)):

    __________________________________________________
    Project "/Users/username/test/prose/ProgramSynthesis/ProseSample.Substrings/ProseSample.Substrings.csproj" is building "/Users/username/test/prose/ProgramSynthesis/ProseSample.Substrings.Semantics/ProseSample.Substrings.Semantics.csproj" (GetNativeManifest target(s)):

Target GenerateTargetFrameworkMonikerAttribute:
  Skipping target "GenerateTargetFrameworkMonikerAttribute" because all output files are up-to-date with respect to the input files.
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"
    /Users/username/.nuget/packages/microsoft.programsynthesis.dslctargets/6.20.0/build/Microsoft.ProgramSynthesis.DslcTargets.targets(82,9): error MSB3073: The command "dotnet dslc  "@/Users/username/test/prose/ProgramSynthesis/ProseSample.Substrings/obj/ProseSample.Substrings.rsp"" exited with code 1.
Done building target "CompileGrammar" in project "ProseSample.Substrings.csproj" -- FAILED.

Done building project "ProseSample.Substrings.csproj" -- FAILED.

Build FAILED.

/Users/username/.nuget/packages/microsoft.programsynthesis.dslctargets/6.20.0/build/Microsoft.ProgramSynthesis.DslcTargets.targets(82,9): error MSB3073: The command "dotnet dslc  "@/Users/username/test/prose/ProgramSynthesis/ProseSample.Substrings/obj/ProseSample.Substrings.rsp"" exited with code 1.
    0 Warning(s)
    1 Error(s)

Time Elapsed 00:00:01.21

========== Build: 1 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Build: 1 error, 0 warnings

提前谢谢你!

EN

回答 1

Stack Overflow用户

发布于 2020-05-29 05:47:03

有了最新的PROSE v7.11.1和下面的步骤,构建现在似乎通过了macOS。

构建失败是由您环境中的dotnet dslc工具failing to run触发的。

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

代码语言:javascript
复制
$ cd ProseSample
$ dotnet add package Microsoft.ProgramSynthesis.Dslc --version 7.11.1

接下来,似乎运行这个工具的跨平台方式是不同的,它负责DSL代码生成的强制步骤- dotnet run dslc

代码语言:javascript
复制
$ dotnet run dslc
$ dotnet build

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

我假设为了让构建在集成开发环境中工作,人们还必须编辑~.nuget/packages/microsoft.programsynthesis.dslctargets/7.11.1/build/Microsoft.ProgramSynthesis.DslcTargets.targets,并用dotnet run dslc替换所有2次出现的dotnet dslc

希望这能有所帮助!

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/56408683

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档