question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Could not load file or assembly 'mscorlib' on macOS

See original GitHub issue

I’m setting up CI to ensure my assembly-based module (PsHosts) runs on Linux and macOS. The process builds on Appveyor/Windows since I’m targetting .NET 4.0 (for compat back to PS3) - the TravisCI builds then install the module from a MyGet feed and run the pester tests.

The Appveyor and Travis Linux builds are both fine, but on Travis macOS calling any of the Cmdlets inside the assembly throw an error:

Could not load file or assembly ‘mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089’. Could not find or load a specific file. (Exception from HRESULT: 0x80131621)

Is this a known issue on macOS? Should I just hold off testing on macOS until a particular release/milestone?

I’m using PowerShell’s install-powershell.sh to bootstrap PS in the Travis builds.

Links to build logs if you’re interested:

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:17 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
richardszalaycommented, Aug 9, 2017

Confirmed that #4506 fixed the issue. Thanks Travis!

0reactions
TravisEz13commented, Aug 5, 2017

Root cause was found, and filed issue #4505

Read more comments on GitHub >

github_iconTop Results From Across the Web

Could not load file or assembly mscorlib - dll
1 Answer 1 ... SThis is a very common problem. As of .NET Core 1.1 you cannot load libraries built for the .NET...
Read more >
How to resolve “Could not load file or assembly … or one of its ...
Thus, another solution is to update NuGet package in all root project and then in subsequent referred project (if required) where same package...
Read more >
Could not load 64bit file or assembly DLL on Mac OS ...
I'm loading assembly file with extension .dll using visual studio 2022 on mac M1 machine, the code is compiling successfully, ...
Read more >
Could not load type 'System.Object' from assembly 'mscorlib'
"Could not load type 'System.Object' from assembly 'mscorlib'" error after activating a module or moving the project to another environment.
Read more >
Could Not Load File or Assembly or One of It's Dependencies
After download, verify that components are installed properly by following "C:\Windows\Microsoft.NET\assembly\GAC_MSIL" path. enter image ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found