Welcome to the Inedo Forums! Check out the Forums Guide for help getting started.

If you are experiencing any issues with the forum software, please visit the Contact Form on our website and let us know!

Powershell WMI Agent issue, Error scanning PowerShell agent: Could not load file or assembly Microsoft.Management.Infrastructure



  • I only found one other instance of this in the forum and it went away on it's own for them somehow. I confirmed the Microsoft.Management.Infrastructure.CimCmdlets.dll PublicKeyToken in C:\Program Files\Otter\Service matched the error in case there was a version mismatch. I've reinstalled repreatedly, tried old versions, restarted, nothing is helping. I can get a newer version from nuget but not sure that would work.

    Logged: 10/13/2023 3:09:32 PM
     Level: Error
     Category: ServerCheckerRunner
     Message: Error scanning PowerShell agent: Could not load file or assembly 'Microsoft.Management.Infrastructure, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. The system cannot find the file specified.
     Details: System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.Management.Infrastructure, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. The system cannot find the file specified.
    File name: 'Microsoft.Management.Infrastructure, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'
    at System.Management.Automation.CimClassDeserializationCache`1..ctor()
    at System.Management.Automation.DeserializationContext..ctor(DeserializationOptions options, PSRemotingCryptoHelper cryptoHelper)
    at System.Management.Automation.Remoting.Fragmentor..ctor(Int32 fragmentSize, PSRemotingCryptoHelper cryptoHelper)
    at System.Management.Automation.Remoting.BaseTransportManager..ctor(PSRemotingCryptoHelper cryptoHelper)
    at System.Management.Automation.Remoting.Client.BaseClientTransportManager..ctor(Guid runspaceId, PSRemotingCryptoHelper cryptoHelper)
    at System.Management.Automation.Remoting.Client.BaseClientSessionTransportManager..ctor(Guid runspaceId, PSRemotingCryptoHelper cryptoHelper)
    at System.Management.Automation.Remoting.Client.WSManClientSessionTransportManager..ctor(Guid runspacePoolInstanceId, WSManConnectionInfo connectionInfo, PSRemotingCryptoHelper cryptoHelper, String sessionName)
    at System.Management.Automation.Runspaces.WSManConnectionInfo.CreateClientSessionTransportManager(Guid instanceId, String sessionName, PSRemotingCryptoHelper cryptoHelper)
    at System.Management.Automation.Remoting.ClientRemoteSessionDSHandlerImpl..ctor(ClientRemoteSession session, PSRemotingCryptoHelper cryptoHelper, RunspaceConnectionInfo connectionInfo, URIDirectionReported uriRedirectionHandler)
    at System.Management.Automation.Remoting.ClientRemoteSessionImpl..ctor(RemoteRunspacePoolInternal rsPool, URIDirectionReported uriRedirectionHandler)
    at System.Management.Automation.Internal.ClientRunspacePoolDataStructureHandler.CreateClientRemoteSession(RemoteRunspacePoolInternal rsPoolInternal)
    at System.Management.Automation.Internal.ClientRunspacePoolDataStructureHandler..ctor(RemoteRunspacePoolInternal clientRunspacePool, TypeTable typeTable)
    at System.Management.Automation.Runspaces.Internal.RemoteRunspacePoolInternal.CreateDSHandler(TypeTable typeTable)
    at System.Management.Automation.Runspaces.Internal.RemoteRunspacePoolInternal..ctor(Int32 minRunspaces, Int32 maxRunspaces, TypeTable typeTable, PSHost host, PSPrimitiveDictionary applicationArguments, RunspaceConnectionInfo connectionInfo, String name)
    at System.Management.Automation.Runspaces.RunspacePool..ctor(Int32 minRunspaces, Int32 maxRunspaces, TypeTable typeTable, PSHost host, PSPrimitiveDictionary applicationArguments, RunspaceConnectionInfo connectionInfo, String name)
    at System.Management.Automation.RemoteRunspace..ctor(TypeTable typeTable, RunspaceConnectionInfo connectionInfo, PSHost host, PSPrimitiveDictionary applicationArguments, String name, Int32 id)
    at System.Management.Automation.Runspaces.RunspaceFactory.CreateRunspace(RunspaceConnectionInfo connectionInfo, PSHost host, TypeTable typeTable, PSPrimitiveDictionary applicationArguments, String name)
    at System.Management.Automation.Runspaces.RunspaceFactory.CreateRunspace(RunspaceConnectionInfo connectionInfo, PSHost host, TypeTable typeTable)
    at Inedo.Agents.PowerShell.PowerShellAgentClient.Connect(PowerShellConnectionInfo connectionInfo)
    at Inedo.Agents.PowerShell.PowerShellAgentClient.ConnectAsync(PowerShellConnectionInfo connectionInfo)
    at Inedo.Otter.Service.Agents.PowerShellAgentConnection.CreateAsync(PowerShellAgent agent, Boolean connect, CancellationToken cancellationToken)
    at Inedo.Otter.Extensions.Agents.ConnectingAgent.GetConnectionAsync(CancellationToken cancellationToken)
    at Inedo.Otter.Service.TaskRunners.ServerCheckerRunner.<>c__DisplayClass14_0.<<CheckPowerShellAgentAsync>g__internalScan|0>d.MoveNext()
    

  • inedo-engineer

    You may have also seen this message but...

    What Windows server version is Otter installed on? That might help us narrow this down.

    We have seen that error if RSAT is not enabled:
    https://learn.microsoft.com/en-us/troubleshoot/windows-server/system-management-components/remote-server-administration-tools

    Cheers,
    Alana


Log in to reply
 

Inedo Website HomeSupport HomeCode of ConductForums GuideDocumentation