加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

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

发布时间:2020-12-15 04:17:10 所属栏目:百科 来源:网络整理
导读:XBuild Engine Version 12.0Mono,Version 3.2.8.0 我试图在XBuild中构建我的C#解决方案.它在Windows中构建非常好,但不是在ubuntu中.我收到以下错误: warning : Project has unknown ToolsVersion '14.0'. Using the default tools version '4.0' instead.Ta
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?

和类似.我已经将RedditSharp.dll添加到GAC,所以我不知道为什么它找不到它,我当然不知道为什么它找不到IReadOnlyCollection.我怀疑这一切都是因为我不能使用ToolsVersion 14.0.

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

解决方法

14表示MSBuild 14,它是Visual Studio 2015的一部分.通常,Mono xbuild在一段时间后才支持最新的Visual Studio版本.所以你要么等到更新,要么hack xbuild,如果你喜欢.

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

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读