gpt4 book ai didi

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

转载 作者:太空狗 更新时间:2023-10-29 17:44:33 28 4
gpt4 key购买 nike

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/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com