mono - 这些 Mono/xbuild 警告是什么意思,我该如何修复它们?

标签 mono xbuild

我使用 Mono 的 xbuild 2.10.5.0 构建 VS2010 项目。这些项目使用“.NET Framework 3.5 客户端配置文件”作为目标框架(它们必须与 3.5 兼容,我只需要客户端配置文件部分)。

我收到以下警告:

Build succeeded.

Warnings:

c:\Project\MyProject.csproj (default targets) -> C:\PROGRA~2\Mono\lib\mono\4.0\Microsoft.Common.targets (GetReferenceAssemblyPaths target) ->
    C:\PROGRA~2\Mono\lib\mono\4.0\Microsoft.Common.targets:  warning : Unable to find framework corresponding to the target framework moniker '.NETFramework,Version=v3.5,Profile=Client'. Framework assembly references will be resolved from the GAC, which might not be the intended behavior.

c:\Project\MyProject.csproj (default targets) -> C:\PROGRA~2\Mono\lib\mono\4.0\Microsoft.Common.targets (ResolveAssemblyReferences target) ->
    C:\PROGRA~2\Mono\lib\mono\4.0\Microsoft.Common.targets:  warning : Reference 'mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' not resolved
    C:\PROGRA~2\Mono\lib\mono\4.0\Microsoft.Common.targets:  warning : Found a conflict between : 'System' and 'System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'. Using 'System' reference.
    C:\PROGRA~2\Mono\lib\mono\4.0\Microsoft.Common.targets:  warning : Found a conflict between : 'System.Core' and 'System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'. Using 'System.Core' reference.

恐怕我不明白这些和唯一的谷歌命中 "Unable to find framework corresponding to the target framework moniker"是该错误消息的提交。

这些警告是什么意思,我该如何解决? Mono 根本不支持“客户端配置文件”吗?如果是这样,我在 Mono 文档中找不到任何相关信息。 Unresolved 原因是什么mscorlib引用和这两个在哪里System引用它报告之间的冲突?

最佳答案

您猜对了 - Mono 不支持“客户端”配置文件(例如,搜索 Mono version of 3.5 Microsoft.Common.targets 以获取任何提及“客户端”的内容),仅支持完整的 3.5 和 4.0 配置文件。要修复它们,您需要在项目文件中指定受支持的配置文件之一。配置文件选择仅限制构建期间可用的引用集,使用“客户端”配置文件编译的程序集将适用于“完整”配置文件。
mscorlib, Version=2.0.0.0正在发生未解析的引用,因为您正在使用 4.0 配置文件(这是默认回退)进行编译。一旦您将配置文件设置为支持的值,它就会消失。如果不想更改项目文件,可以使用 xbuild /p:TargetFrameworkProfile="" 构建,它正确地选择了 3.5 组程序集。

关于mono - 这些 Mono/xbuild 警告是什么意思,我该如何修复它们?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7228499/

相关文章:

c# - DBreeze 在单声道中无法正常运行

Python subprocess.popen 在与子进程交互时失败

linux - xbuild:任务 GenerateResource FAILED,认为不存在的文件比源文件更新

msbuild - XBuild 报告项目文件过多但适用于 MSBuild

c# - Unix 上的 Mono - 文件系统 ACL

.net - 如何确定文件系统在 .net 中是否区分大小写?

c# - 无法在 Mono 和 Linux 下构建 NUnit 测试项目

c# - 尝试从 Mono NUnit 测试中获取调试输出

mysql - 如何在 Mac 上使用 DbLinq SqlMetal for MySQL?

ubuntu - Monogame Linux 在启动时崩溃