PowerShell / PowerShellStandard

MIT License
158 stars 24 forks source link

Could not load file or assembly 'System.Management.Automation.resources' #21

Closed jherby2k closed 6 years ago

jherby2k commented 6 years ago

I've been getting this error as of late with my netstandard 2.0 binary module. It wasn't happening a month or so back, and I'm a bit stumped as to what introduced it.

This is with PowerShellStandard.Library 5.1.0-preview-03 or earlier.

Could not load file or assembly 'System.Management.Automation.resources, Version=3.0.0.0, Culture=en-US, PublicKeyToken=31bf3856ad364e35' or one of its dependencies.

jherby2k commented 6 years ago

Not sure why that was the error message, but it turned out to be a library loading problem unrelated to PS.

TjD2L commented 2 years ago

Long shot, but do you recall what the issue was in your case @jherby2k ? This sometimes randomly occurs with my Binary Module

jherby2k commented 2 years ago

@TjD2L Oh man this is so long ago... I believe my issue was due to how i was loading plugins located in another directory (I use System.Composition). Try adding a handler for AssemblyLoadContext.Default.Resolving and see if you can figure out where its looking and why its failing to find it.