我正在使用:
<NoStdLib>
;也就是说,它保持默认状态。
<TargetFrameworkVersion>
设置为v4.6.2。
当我在IDE中构建时,我看不到任何警告或错误。但是,当我使用
构建解决方案时msbuild /v:detailed my.sln
我看到其中一些消息:
Dependency "mscorlib, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea77
98e, Retargetable=Yes".
Could not resolve this reference. Could not locate the assembly "mscorlib, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e, Retargetable=Yes". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.
浏览Mono文件时,以下所有程序集都与上述版本和密钥匹配:
/usr/lib/mono/xbuild-frameworks/.NETPortable/v4.0/Profile/Profile102/mscorlib.dll
/usr/lib/mono/xbuild-frameworks/.NETPortable/v4.0/Profile/Profile19/mscorlib.dll
/usr/lib/mono/xbuild-frameworks/.NETPortable/v4.0/Profile/Profile225/mscorlib.dll
/usr/lib/mono/xbuild-frameworks/.NETPortable/v4.0/Profile/Profile5/mscorlib.dll
/usr/lib/mono/xbuild-frameworks/.NETPortable/v4.0/Profile/Profile92/mscorlib.dll
/usr/lib/mono/xbuild-frameworks/.NETPortable/v4.0/Profile/Profile47/mscorlib.dll
/usr/lib/mono/xbuild-frameworks/.NETPortable/v4.0/Profile/Profile14/mscorlib.dll
/usr/lib/mono/xbuild-frameworks/.NETPortable/v4.0/Profile/Profile24/mscorlib.dll
/usr/lib/mono/xbuild-frameworks/.NETPortable/v4.0/Profile/Profile328/mscorlib.dll
/usr/lib/mono/xbuild-frameworks/.NETPortable/v4.0/Profile/Profile6/mscorlib.dll
/usr/lib/mono/xbuild-frameworks/.NETPortable/v4.0/Profile/Profile158/mscorlib.dll
/usr/lib/mono/xbuild-frameworks/.NETPortable/v4.0/Profile/Profile255/mscorlib.dll
/usr/lib/mono/xbuild-frameworks/.NETPortable/v4.0/Profile/Profile37/mscorlib.dll
/usr/lib/mono/xbuild-frameworks/.NETPortable/v4.0/Profile/Profile240/mscorlib.dll
/usr/lib/mono/xbuild-frameworks/.NETPortable/v4.0/Profile/Profile136/mscorlib.dll
/usr/lib/mono/xbuild-frameworks/.NETPortable/v4.0/Profile/Profile147/mscorlib.dll
/usr/lib/mono/xbuild-frameworks/.NETPortable/v4.0/Profile/Profile42/mscorlib.dll
/usr/lib/mono/xbuild-frameworks/.NETPortable/v4.0/Profile/Profile344/mscorlib.dll
/usr/lib/mono/xbuild-frameworks/.NETPortable/v4.0/Profile/Profile336/mscorlib.dll
/usr/lib/mono/xbuild-frameworks/.NETPortable/v4.0/mscorlib.dll
其他mscorlib
程序集的版本错误,或者使用密钥令牌b77a5c561934e089
而不是7cec85d7bea7798e
。
我的问题是:
提前致谢。
修改
使用monodis --assemblyref
,我发现问题是Common.Logging
:
Common.Logging.dll
AssemblyRef Table
...
4: Version=2.0.5.0
Name=mscorlib
Flags=0x00000100
Public Key:
0x00000000: 7C EC 85 D7 BE A7 79 8E
./Common.Logging.Core.dll
AssemblyRef Table
...
1: Version=2.0.5.0
Name=mscorlib
Flags=0x00000100
Public Key:
0x00000000: 7C EC 85 D7 BE A7 79 8E
./Common.Logging.NLog41.dll
AssemblyRef Table
...
6: Version=2.0.5.0
Name=mscorlib
Flags=0x00000100
Public Key:
0x00000000: 7C EC 85 D7 BE A7 79 8E
尽管我的packages.config
特别要求.NET 4.62:
<package id="Common.Logging" version="3.3.1" targetFramework="net462" />
<package id="Common.Logging.Core" version="3.3.1" targetFramework="net462" />
<package id="Common.Logging.NLog41" version="3.3.1" targetFramework="net462" />
所以我猜这是Common.Logging
中的错误?