8

我使用 Mono 的 xbuild 2.10.5.0 构建 VS2010 项目。这些项目使用“.NET Framework 3.5 Client Profile”作为目标框架(它们必须与 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.

恐怕我不理解这些,并且“无法找到与目标框架名字对象相对应的框架”的唯一 Google 命中是该错误消息的提交。

这些警告是什么意思,我该如何解决?Mono 根本不支持“客户端配置文件”吗?如果是这样,我在 Mono 文档中找不到任何相关内容。是什么导致了未解析的mscorlib引用,这两个System引用在哪里报告了冲突?

4

1 回答 1

7

您猜对了 - Mono 不支持“客户端”配置文件(例如,搜索Mono 版本的 3.5 Microsoft.Common.targets以查找任何提及“客户端”),仅支持完整的 3.5 和 4.0 配置文件。要修复它们,您需要在项目文件中指定支持的配置文件之一。配置文件选择仅限制构建期间可用的引用集,使用“客户端”配置文件编译的程序集将在“完整”配置文件上正常工作。

发生未mscorlib, Version=2.0.0.0解析的引用是因为您正在使用 4.0 配置文件(这是默认后备)进行编译。一旦您将个人资料设置为受支持的值,它就会消失。如果您不想更改项目文件,可以使用 构建xbuild /p:TargetFrameworkProfile="",它正确选择了 3.5 集程序集。

于 2011-08-29T09:54:41.707 回答