gpt4 book ai didi

c# - MonoDevelop无法导入VS2013/2015的解决办法

转载 作者:太空狗 更新时间:2023-10-29 18:24:41 24 4
gpt4 key购买 nike

我正在打开一个从 VS2013 传输到 MonoDevelop 的 .sln 文件。但是,当我尝试这样做时,出现以下错误:

1. Project 'foo' has a different ToolsVersion than the containing solution.
2. Error while trying to load the project '/path/to/foo.csproj': Unknown ToolsVersion '12.0'
3. [repeat 2 for every project in the solution]

当我尝试对 VS2015 文件执行此操作时,它让我犯了同样的错误,除了这次 ToolsVersion14.0

我的MonoDevelop版本是v4.0.12;有解决办法吗?

最佳答案

我知道 MonoDevelop 5.x+/Mono 4.x 有 xbuild/MSBuild 支持工具版本 12。所以让我们检查你的安装。

检查单声道安装:

单声道--版本

Mono JIT compiler version 4.0.2 ((detached/c99aa0c Thu Jun 11 18:53:01 EDT 2015)

xbuild --version

XBuild Engine Version 12.0
Mono, Version 4.0.2.0**

检查您的 GAC 安装:

gacutil -l |grep Microsoft.Build

Microsoft.Build, Version=12.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
Microsoft.Build, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
Microsoft.Build, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
Microsoft.Build.Engine, Version=12.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
Microsoft.Build.Engine, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
Microsoft.Build.Engine, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
Microsoft.Build.Framework, Version=12.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
Microsoft.Build.Framework, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
Microsoft.Build.Framework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
Microsoft.Build.Tasks.Core, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
Microsoft.Build.Tasks.v12.0, Version=12.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
Microsoft.Build.Tasks.v4.0, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
Microsoft.Build.Utilities.Core, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
Microsoft.Build.Utilities.v12.0, Version=12.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
Microsoft.Build.Utilities.v4.0, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a

检查您是否有 MSBuild dll(路径也依赖于平台,根据需要更改):

cat `which xbuild`

#!/bin/sh
exec /Library/Frameworks/Mono.framework/Versions/4.0.2/bin/mono $MONO_OPTIONS /Library/Frameworks/Mono.framework/Versions/4.0.2/lib/mono/xbuild/12.0/bin/xbuild.exe "$@"

从上面的输出中获取您的 Mono 安装路径并更改下面的路径以匹配:

找到/Library/Frameworks/Mono.framework/Versions/4.0.2 -name "*MSBuild"

/Library/Frameworks/Mono.framework/Versions/4.0.2/lib/mono/4.5/MSBuild
/Library/Frameworks/Mono.framework/Versions/4.0.2/lib/mono/gac/Mono.Addins.MSBuild
/Library/Frameworks/Mono.framework/Versions/4.0.2/lib/mono/gac/policy.0.2.Mono.Addins.MSBuild
/Library/Frameworks/Mono.framework/Versions/4.0.2/lib/mono/gac/policy.0.3.Mono.Addins.MSBuild
/Library/Frameworks/Mono.framework/Versions/4.0.2/lib/mono/gac/policy.0.4.Mono.Addins.MSBuild
/Library/Frameworks/Mono.framework/Versions/4.0.2/lib/mono/gac/policy.0.5.Mono.Addins.MSBuild
/Library/Frameworks/Mono.framework/Versions/4.0.2/lib/mono/gac/policy.0.6.Mono.Addins.MSBuild
/Library/Frameworks/Mono.framework/Versions/4.0.2/lib/mono/xbuild/12.0/bin/MSBuild
/Library/Frameworks/Mono.framework/Versions/4.0.2/lib/mono/xbuild/14.0/bin/MSBuild

如您所见,我的工具版本为 12。根据需要更新您的安装/重新安装 ;-)

关于c# - MonoDevelop无法导入VS2013/2015的解决办法,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31093212/

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