mscorlib is not referenced
abbgrade opened this issue · 6 comments
Hello,
First of all: Thank you for this module.
When I import platyPS, before I load powershell-yaml, I get the following issue:
(7,36): error CS0012: The type 'Object' is defined in an assembly that is not referenced. You must add a reference to assembly 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'. public class StringQuotingEmitter: ChainedEventEmitter {
If I load powershell-yaml before platyPS, the import of platyPS I get:
Assembly with same name is already loaded
I found out, that both modules use YamlDotNet.dll but in different versions. Both outdated, but this is not the issue.
I think, there are patterns to solve this: https://github.com/jborean93/PowerShell-ALC contains an example.
sigh
Yes. We'll probably go with load contexts in the end. When we created the module, we wanted to allow users to not use the bundled assembly, provided they go for a newer version or use their own. This was done mostly because on some organizations, opaque binary blobs are frowned upon. So we check if the assembly is loaded and only load it if it doesn't exist. But as you and others have come to notice, it sometimes bites back.
I will allocate some time to make the needed changes. Will ping back here when I have something.
thanks a lot. I feed you pain. I have the same task for a few modules, I maintain.