我正在尝试在Mono上构建一个.NET项目。
efulmer:[~/projects/MyApp]$ msbuild MyApp.csproj
Microsoft (R) Build Engine version 15.3.0.0 ( Mon Aug 14 21:03:24 UTC 2017) for Mono
Copyright (C) Microsoft Corporation. All rights reserved.
Build started 10/11/2017 3:46:23 PM.
Project "/home/efulmer/projects/MyApp/MyApp.csproj" on node 1 (default targets).
/home/efulmer/projects/MyApp/MyApp.csproj(161,3): error MSB4019: The imported project "/usr/lib/mono/msbuild/15.0/bin/Microsoft.CompactFramework.CSharp.targets" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.
Done Building Project "/home/efulmer/projects/MyApp/MyApp.csproj" (default targets) -- FAILED.
Build FAILED.
"/home/efulmer/projects/MyApp/MyApp.csproj" (default target) (1) ->
/home/efulmer/projects/MyApp/MyApp.csproj(161,3): error MSB4019: The imported project "/usr/lib/mono/msbuild/15.0/bin/Microsoft.CompactFramework.CSharp.targets" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.
0 Warning(s)
1 Error(s)
Time Elapsed 00:00:00.14
有问题的行是<Import Project="$(MSBuildBinPath)/Microsoft.CompactFramework.CSharp.targets" />
在我进行一些搜索(缺少.NET Compact Framework)之后,基本问题对我来说相当明显,但我不知道如何解决它,因为我安装了mono-complete
。但我不知道如何解决它。帮助赞赏!
答案 0 :(得分:0)
您可能会区分大小写。我在程序中找不到Microsoft.CSHARP.Targets
事实证明,MSBuild提供了一个名为Microsoft.CSharp.targets
的文件
我创建了从Microsoft.CSHARP.Targets
到Microsoft.CSharp.targets
的符号链接,并且可以解决此问题。