这些 Mono/xbuild 警告是什么意思以及如何修复它们?
我使用 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.
恐怕我不明白这些以及 “无法找到与目标框架名称相对应的框架” 是以下内容的提交该错误消息。
这些警告是什么意思以及如何解决它们? Mono 根本不支持“客户端配置文件”吗?如果是这样,我在 Mono 文档中找不到任何相关内容。是什么导致 mscorlib
引用无法解析?它报告的这两个 System
引用之间的冲突在哪里?
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).
I'm getting the following warnings:
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.
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您猜对了 - Mono 不支持“客户端”配置文件(例如搜索 Mono 版本 3.5 Microsoft.Common.targets(对于任何提及“客户端”的情况),仅限完整的 3.5 和 4.0 配置文件。要修复它们,您需要在项目文件中指定受支持的配置文件之一。配置文件选择仅限制构建期间可用的引用集,使用“客户端”配置文件编译的程序集将在“完整”配置文件上正常工作。
发生
mscorlib, Version=2.0.0.0
未解析的引用是因为您正在使用 4.0 配置文件(这是默认后备)进行编译。一旦您将您的配置文件设置为支持的值,它就会消失。如果您不想更改项目文件,可以使用xbuild /p:TargetFrameworkProfile=""
进行构建,它会正确选择 3.5 的程序集集。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.
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 withxbuild /p:TargetFrameworkProfile=""
, which correctly chooses the 3.5 set of assemblies.