这些Mono/xbuild警告是什么意思,我该如何解决? [英] What do these Mono/xbuild warnings mean and how do I fix them?

查看:239
本文介绍了这些Mono/xbuild警告是什么意思,我该如何解决?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用Mono的xbuild 2.10.5.0构建VS2010项目.这些项目使用".NET Framework 3.5客户端配置文件"作为目标框架(它们必须与3.5兼容,并且我不需要的内容超过客户端配置文件的一部分).

I build VS2010 projects with Mono's xbuild 2.10.5.0. The projects use the '.NET Framework 3.5 Client Profile' as the target framework (they must be 3.5 compatible and I don't need more than the client profile parts).

我收到以下警告:

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.

恐怕我听不懂这些内容,而且是是该错误消息的提交.

I'm afraid I don't understand these and the only Google hit for "Unable to find framework corresponding to the target framework moniker" is the commit for that error message.

这些警告是什么意思,我该如何解决? Mono完全不支持客户资料"吗?如果是这样,我在Mono文档中找不到关于此的任何信息.导致未解决的mscorlib引用的原因是什么,并且这两个System引用之间存在冲突?

What do these warnings mean and how can I fix them? Is the 'client profile' not supported by Mono at all? If so, I couldn't find anything about that in the Mono documentation. What causes the unresolved mscorlib reference and where are these two System references it reports a conflict between?

推荐答案

您猜对了-Mono不支持客户端"配置文件(例如,搜索Mono版本的3.5 Microsoft.Common.targets (提及客户端"),只有完整的3.5和4.0个人资料.要修复它们,您需要在项目文件中指定受支持的配置文件之一.概要文件的选择仅限制在构建过程中可用的引用集,使用客户端"概要文件编译的程序集将在完整"概要文件上正常工作.

You are guessing correctly - Mono does not support the 'Client' profile (e.g. search Mono version of 3.5 Microsoft.Common.targets for any mention of 'Client'), only the full 3.5 and 4.0 profiles. To fix them, you need to specify one of the supported profiles in your project file. Profile selection only restricts the set of references available during build, an assembly compiled with the 'Client' profile will work on the 'Full' profile just fine.

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

The mscorlib, Version=2.0.0.0 unresolved reference is happening because you are compiling with a 4.0 profile (which is the default fallback). It will disappear once you set your profile to a supported value. If you do not want to change your project file, you can build with xbuild /p:TargetFrameworkProfile="", which correctly chooses the 3.5 set of assemblies.

这篇关于这些Mono/xbuild警告是什么意思,我该如何解决?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆