MonoDevelop可以';t导入VS2013/2015解决方案

本文关键字:VS2013 2015 解决方案 导入 可以 MonoDevelop | 更新日期: 2023-09-27 18:00:01

我正在打开一个从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版本是4.0.12版;有解决办法吗?

MonoDevelop可以';t导入VS2013/2015解决方案

我知道MonoDevelop 5.x+/Mono 4.x支持xbuild/MBuild Toolsversion 12。所以让我们检查一下你的安装。

检查Mono安装:

单声道--版本

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

xbuild--版本

XBuild Engine Version 12.0
Mono, Version 4.0.2.0**

检查您的GAC安装:

gautil-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安装路径,并更改下面的路径以匹配:

find/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

正如你所看到的,我有Tools版本12。根据需要更新您的安装/重新安装;-)

解决方案包括:

  1. 升级至MonoDevelop 5,它支持使用Tools版本12.0的项目
  2. 编辑.csproj文件并将Tools Version更改为4.0

    <项目工具Version="4.0"

如果你选择2。然后,您将不得不查看该项目在该更改之后是否仍在构建。