Cannot find assembly 'mscorlib, version=, culture=neutral, publickeytoken=7cec85d7bea7798e in jetbrains/teamcity-agent:latest-windowsservercore

akubenko's Avatar


06 Feb, 2018 01:48 AM


I created a build agent on Windows Server 2016 using :
docker run -it -e SERVER_URL="" -v C:/Docker/BuildAgent/NetFramwork4_conf:C:/BuildAgent/conf jetbrains/teamcity-agent:latest-windowsservercore

Then I authorize that agent in Teamcity server then when I run a build of my project I get next error:
unknown error PS0264: Cannot find assembly 'mscorlib, version=, culture=neutral, publickeytoken=7cec85d7bea7798e'. [Public key mismatch]. Build your project with detailed verbosity to see the assembly loading log.
C:\BuildAgent\work\ffbd708c268dd5e6\packages\PostSharp.5.0.44\build\PostSharp.targets(314, 5): The process C:\ProgramData\PostSharp\5.0.44\bin.Release\postsharp-net40-x86-native.exe exited with code 11.

I also tried installing .Net Framework 3.5 before authorizing build agent and it did not help.
To install .NetFramework 3.5 I did:
- Fixed paste issue


docker ps
docker exec -it <container-id-received-from prev-command> powershell

Invoke-WebRequest -UseBasicParsing -Uri "" -OutFile;
Add-WindowsPackage -Online -PackagePath .\microsoft-windows-netfx3\;

then did a check that .Net 2.0 - 3.5 present:
PS C:\Windows\Microsoft.NET\Framework64> dir

    Directory: C:\Windows\Microsoft.NET\Framework64

Mode LastWriteTime Length Name
---- ------------- ------ ----
d----- 2/6/2018 12:18 PM v2.0.50727
d----- 2/6/2018 12:18 PM v3.0
d----- 2/6/2018 12:18 PM v3.5
d----- 2/6/2018 12:19 PM v4.0.30319
-a---- 7/16/2016 11:10 PM 8704 sbscmp10.dll
-a---- 7/16/2016 11:10 PM 8704 sbscmp20_mscorwks.dll
-a---- 7/16/2016 11:10 PM 8704 sbscmp20_perfcounter.dll
-a---- 7/16/2016 11:10 PM 8704 SharedReg12.dll

then restarted container and authorized it in TC, started build of my project and still have exactly same problem.

What do I do?

  1. 1 Posted by akubenko on 06 Feb, 2018 03:21 AM

    akubenko's Avatar

    Found similar question . My solution was using one PCL, which I get rid of yesterday.I converted it to normal project library and still have issue.
    Also tried to delete folder which was mentioned in the post. Logs:
    Microsoft Windows [Version 10.0.14393]
    (c) 2016 Microsoft Corporation. All rights reserved.

    C:\>cd C:\ProgramData\PostSharp\BindingMaps

     Volume in drive C has no label.
     Volume Serial Number is CEDC-E205

     Directory of C:\ProgramData\PostSharp\BindingMaps

    02/06/2018 12:31 PM <DIR> .
    02/06/2018 12:31 PM <DIR> ..
    02/06/2018 12:31 PM <DIR> v8
                   0 File(s) 0 bytes
                   3 Dir(s) 17,540,136,960 bytes free

    C:\ProgramData\PostSharp\BindingMaps>cd c:\

    c:\>rd /S /Q C:\ProgramData\PostSharp\BindingMaps

    c:\>cd C:\ProgramData\PostSharp\BindingMaps
    The system cannot find the path specified.

    The problem still happens after I deleted the folder. The problem actually happens on 2 test projects using NUnit. I have some other test projects and no problems there. I disabled Build in solution for Release configuration and it worked fine. So I have the problem only in 2 test projects.

  2. Support Staff 2 Posted by PostSharp Techn... on 06 Feb, 2018 02:01 PM

    PostSharp Technologies's Avatar


    thank you for reporting this issue in detail. May I ask you to provide us a project which reproduces this issue?

    Could you please also tell us the number in the beginning of your license key? (The number which is in the beginning and is delimited from the rest of the key using a dash.) Or if you don't have a license key, which license do you use to build with PostSharp?

    Best regards,

  3. Support Staff 3 Posted by PostSharp Techn... on 20 Feb, 2018 03:40 PM

    PostSharp Technologies's Avatar


    We are going to close this request as there have not been any further updates. Please feel free to reopen the discussion if you need more help.

    PostSharp Team

  4. PostSharp Technologies closed this discussion on 20 Feb, 2018 03:40 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts


? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac