c# - 如何让 Mono 使用正确的 'ToolsVersion' ?

标签 c# ubuntu mono

XBuild Engine Version 12.0
Mono, Version 3.2.8.0

我正在尝试在 XBuild 中构建我的 C# 解决方案。它在 Windows 中构建得非常好,但在 Ubuntu 中却不行。我收到以下错误:

warning : Project has unknown ToolsVersion '14.0'. Using the default tools version '4.0' instead.
Target GetFrameworkPaths:
/usr/lib/mono/4.5/Microsoft.Common.targets:  warning : TargetFrameworkVersion 'v4.5.2' not supported by this toolset (ToolsVersion: 4.0).
error CS0246: The type or namespace name 'RedditSharp' could not be found. Are you missing an assembly reference?
error CS0246: The type or namespace name `IReadOnlyCollection' could not be found. Are you missing an assembly reference?

和类似的。我已经在GAC中添加了RedditSharp.dll,所以不知道为什么找不到,当然也不知道为什么找不到IReadOnlyCollection。我怀疑这都是因为我不能使用 ToolsVersion 14.0。

有人知道在 Linux 上构建 C# 吗?我做错了什么?

最佳答案

14 表示 MSBuild 14,它是 Visual Studio 2015 的一部分。通常 Mono xbuild 只支持最新的 Visual Studio 版本一段时间后。因此,您要么等到它更新,要么根据需要破解 xbuild。

另一种解决方法是将您的项目转换为 MSBuild 版本 12

关于c# - 如何让 Mono 使用正确的 'ToolsVersion' ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32296141/

相关文章:

ubuntu - .net core web api访问容器中的文件夹

.net - Mono 在哪里存储 xml 文档?

c# - 如何阻塞一个线程,直到另一个线程在 C# 中获得服务器响应

c# - 如何减少行数的边距大小

Android 模拟器在 Ubuntu 17.04 上运行速度极慢

amazon-web-services - 如何根据允许的来源列表设置 Access-Control-Allow-Origin header 的值?

python-2.7 - Ubuntu 和 Ironpython : What paths to add to sys. 路径以及如何导入 fcntl 模块?

macos - 在 Mac OS 10.9.1 上编译 MonoMac 时出错

c# - 在 C# 解决方案中创建 PFX 文件

c# - 在 Azure 中添加、编辑元数据