PostSharp没有在TeamCity上构建:找不到程序集mscorlib

时间:2018-01-10 13:44:16

标签: c# .net postsharp

PostSharp将在本地开发机器上构建,它不会在TeamCity服务器上构建,错误是:

  componentDidMount() {
    Linking.addEventListener('url', event => 
    this.handleOpenURL(event.url));
    Linking.getInitialURL().then(url => {
     console.log('url===',url);
     if(url)
      this.handleOpenURL(url);
   });
  }

以下是构建日志的摘录:

unknown error PS0264: Cannot find assembly 'mscorlib, version=2.0.5.0, culture=neutral, publickeytoken=7cec85d7bea7798e'.

更新

在C:\ ProgramData \ PostSharp \ InstalledFrameworks中比较文件(本地与构建服务器)之后,我可以看到我的本地机器有这些额外的框架:

[13:38:22][PostSharp30] Merging assembly binding policy files.
[13:38:22][PostSharp30] Executing "C:\ProgramData\PostSharp\5.0.43\bin.Release\postsharp-net40-x86-native.exe" <REMOVED SENSITIVE INFORMATION>
[13:38:25][PostSharp30] unknown : verbose PS0265: Detailed log for the next error:
[13:38:25][PostSharp30] unknown : verbose PS0265: LOG: Finding reference assembly with binding identity 'mscorlib, version=2.0.5.0, culture=neutral, publickeytoken=7cec85d7bea7798e' in the Reference context.
[13:38:25][PostSharp30] unknown : verbose PS0265: LOG:  Found file 'C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\mscorlib.dll', identity='mscorlib, version=4.0.0.0, culture=neutral, publickeytoken=b77a5c561934e089', ProcessorArchitecture=NoPlatform.
[13:38:25][PostSharp30] unknown : verbose PS0265: LOG:  Reference mismatch for 'C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\mscorlib.dll' [PublicKeyMismatch].
[13:38:25][PostSharp30] unknown : verbose PS0265: LOG:  Found file 'C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\mscorlib.dll', identity='mscorlib, version=4.0.0.0, culture=neutral, publickeytoken=b77a5c561934e089', ProcessorArchitecture=NoPlatform.
[13:38:25][PostSharp30] unknown : verbose PS0265: LOG:  Reference mismatch for 'C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\mscorlib.dll' [PublicKeyMismatch].
[13:38:25][PostSharp30] unknown : verbose PS0265: LOG:  Found file 'C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\mscorlib.dll', identity='mscorlib, version=4.0.0.0, culture=neutral, publickeytoken=b77a5c561934e089', ProcessorArchitecture=NoPlatform.
[13:38:25][PostSharp30] unknown : verbose PS0265: LOG:  Reference mismatch for 'C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\mscorlib.dll' [PublicKeyMismatch].
[13:38:25][PostSharp30] unknown : verbose PS0265: LOG:  The assembly 'mscorlib, version=2.0.5.0, culture=neutral, publickeytoken=7cec85d7bea7798e, retargetable=yes' was not found.
[13:38:25][PostSharp30] unknown : verbose PS0265: .
[13:38:25][PostSharp30] unknown error PS0264: Cannot find assembly 'mscorlib, version=2.0.5.0, culture=neutral, publickeytoken=7cec85d7bea7798e'. [Public key mismatch]. Build your project with detailed verbosity to see the assembly loading log.
[13:38:25][PostSharp30] C:\BuildAgent\work\be9df088c843a629\src\packages\PostSharp.5.0.43\build\PostSharp.targets(314, 5): The process C:\ProgramData\PostSharp\5.0.43\bin.Release\postsharp-net40-x86-native.exe exited with code 11.
[13:38:25][Step 4/5] Process exited with code 1

2 个答案:

答案 0 :(得分:1)

构建服务器需要Microsoft .NET可移植库参考程序集4.6:

  1. 下载&amp;安装Microsoft .NET Portable Library Reference Assemblies 4.6
  2. C:\Program Files (x86)\Microsoft .NET Portable Library Reference Assemblies 4.6\PortableReferenceAssemblies.zip提取为C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable\
  3. 注意:文件夹“.NETPortable”的字符大小写必须符合定义。使用mkdir创建以句点符号开头的文件夹。

答案 1 :(得分:1)

C:\ProgramData\PostSharp\BindingMaps从本地计算机复制到构建服务器对我来说很有效(Postsharp 4.2.19)