Windows Vista Forums

RunspaceInvoke does not load referenced assemblies?
  1. #1


    nholling Guest

    RunspaceInvoke does not load referenced assemblies?

    I've got a custom application which uses RunspaceInvoke to execute scripts.
    I'm referencing a custom assembly in the my project. When I try to use .net
    class within my referenced assembly in a script. Powershell complains that it
    can't find the class.

    Do assemblies referenced by my CS project get loaded into the PowerShell
    environment or do I have to load the assemblies into the runspace
    specifically?



    I expected the runspace to be loaded into the same process as my custom
    application therefore having access to all the same assemblies referenced by
    the project.

    Thanks,
    -Nate

      My System SpecsSystem Spec

  2. #2


    nholling Guest

    RE: RunspaceInvoke does not load referenced assemblies?



    I was able to get the assembly to load into the runspace. I had do something
    to cause the assembly to be loaded before the runspace was created. To do
    this I called a method on one of the classes within my assembly. Then created
    the runspace.

    My scripts now have access to the classes within the assembly.

    Can someone explain to me why I had to do this? Won't PowerShell cause the
    CLR to load the assembly just like when it was executing my C# code?

      My System SpecsSystem Spec

RunspaceInvoke does not load referenced assemblies? problems?

Similar Threads
Thread Thread Starter Forum Replies Last Post
Retrieving Property Values without Loading Referenced Assemblies dotNetDave .NET General 0 12 Apr 2010
Prevent DLL from being referenced Christiano Donke .NET General 1 12 May 2009
referenced memory at “0x00000004” Dan Cotton .NET General 0 13 Jan 2009
copying files referenced in an array...help? greatbarrier86 PowerShell 4 29 Feb 2008
RunspaceInvoke Doug PowerShell 1 04 Jan 2007