Skip to content

Unable to import module - YamlDotNet already loaded #810

Closed

Description

Prerequisites

  • Write a descriptive title.
  • Make sure you are able to repro it on the latest version
  • Search the existing issues.

Steps to reproduce

Import a module that depends on YamlDotNet
Import Microsoft.PowerShell.PlatyPS

Expected behavior

Module Import successfully.

Actual behavior

PS> Import-Module Microsoft.PowerShell.PlatyPS
Import-Module: Could not load file or assembly 'YamlDotNet, Version=15.0.0.0, Culture=neutral, PublicKeyToken=ec19458f3c15af5e'. Assembly with same name is already loaded

Error details

Environment data

PSVersion                      7.5.2
PSEdition                      Core
GitCommitId                    7.5.2
OS                             Microsoft Windows 10.0.22631
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Version

1.0.1

Visuals

We have a module that has a dependency on YamlDotNet v16. When we import Microsoft.PowerShell.PlatyPS before importing our module to be able to to Get-Module <module-name> for New-MarkdownCommandHelp, we get and error that YamlDotNet is already in use.

If we first import our module, and then import Microsoft.PowerShell.PlatyPS, we get the error specified above.

Activity

  1. marais-vzc commented on Sep 1, 2025

    @marais-vzc
    Author

    🙈 I missed #579 . Once that is fixed, it will also fix this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Resolution-Duplicate

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions