Access StreamInsight Manager using PowerShell


  • Hi! I'm trying to access StreamInsight Manager using PowerShell and we are having some problems.

    I'm following this example:

    and the first line code is not returning anything.

    I have the assemblies installed under this path: C:\Windows\Microsoft.NET\assembly\GAC_MSIL\Microsoft.ComplexEventProcessing instead of C:\Windows\assembly\GAC_MSIL\Microsoft.ComplexEventProcessing (as the blog says).

    I try this line too: Add-Type -Path "C:\Windows\Microsoft.NET\assembly\GAC_MSIL\Microsoft.ComplexEventProcessing\v4.0_21.0.0.0__89845dcd8080cc91\Microsoft.ComplexEventProcessing.dll" but I got the following error:

    Add-Type : No se puede cargar el archivo o ensamblado 'file:///C:\Windows\Microsoft.NET\assembly\GAC_MSIL\Microsoft.ComplexEventProcessing\v4.0_21.0.0.0__89845dcd8080cc91\Microsoft.Co
    mplexEventProcessing.dll' ni una de sus dependencias. Este ensamblado se creó con un tiempo de ejecución más reciente que el tiempo de ejecución cargado actualmente y no se puede carg
    En línea: 1 Carácter: 9
    + Add-Type <<<<  -Path "C:\Windows\Microsoft.NET\assembly\GAC_MSIL\Microsoft.ComplexEventProcessing\v4.0_21.0.0.0__89845dcd8080cc91\Microsoft.ComplexEventProcessing.dll"
        + CategoryInfo          : NotSpecified: (:) [Add-Type], BadImageFormatException
        + FullyQualifiedErrorId : System.BadImageFormatException,Microsoft.PowerShell.Commands.AddTypeCommand

    Thanks in advance.


    Saturday, December 14, 2013 5:28 PM

All replies

  • Hi Bruno,
    Thank you for your question. 
    I am trying to involve someone more familiar with this topic for a further look at this issue. Sometime delay might be expected from the job transferring. Your patience is greatly appreciated. 
    Thank you for your understanding and support.
    Best Regards,
    Allen Li

    Allen Li
    TechNet Community Support

    Monday, December 16, 2013 8:19 AM
  • Thank you Allen!
    Monday, December 16, 2013 9:58 PM
  • A disclaimer: I've never used the PowerShell stuff for StreamInsight.

    That said, a couple of things ... First, the path that you list here is the Global Assembly Cache (GAC). You shouldn't need to supply a path to load the assembly. You mention that the "first line code is not returning anything" ... it should have something. Can you post a copy of all of the commands and the results?

    Second, the error message that you do get seems to indicate loading a 64-bit assembly into a 32-bit process or vice-versa. Is your OS 64 or 32 bit? Which version (64 or 32) of StreamInsight did you install?

    DevBiker (aka J Sawyer)
    Microsoft MVP - Sql Server (StreamInsight)

    Ruminations of

    If I answered your question, please mark as answer.
    If my post was helpful, please mark as helpful.

    Tuesday, December 17, 2013 12:04 PM
  • Sawyer, thanks for the response.

    Of course, I paste those stuff bellow:

    PS C:\Users\Bruno> [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.ComplexEventProcessing")
    $server = [Microsoft.ComplexEventProcessing.Server]::Connect("http://localhost:8765/TSI4Server")
    No se encuentra el tipo [Microsoft.ComplexEventProcessing.Server]: asegúrese de que está cargado el ensamblado que contiene este tipo.
    En línea: 2 Carácter: 52
    + $server = [Microsoft.ComplexEventProcessing.Server] <<<< ::Connect("http://localhost:8765/TSI4Server")
        + CategoryInfo          : InvalidOperation: (Microsoft.ComplexEventProcessing.Server:String) [], RuntimeException
        + FullyQualifiedErrorId : TypeNotFound

    That's all...

    I'm running Windows 7 64-bit and StreamInsight 2.1 64-bit with SQL Server 2012 Enterprise Edition (64-bit).


    Wednesday, December 18, 2013 3:13 PM