Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8631933
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T09:17:04+00:00 2026-06-12T09:17:04+00:00

I was trying to create WCF client following instructions from here: Execute a one-way

  • 0

I was trying to create WCF client following instructions from here:
Execute a one-way wcf service operation from powershell

Here’s the piece of code that is breaking

$contractDescription = [System.ServiceModel.Description.ContractDescription]::GetContract([Iinterface])
$serviceEndpoint = New-Object System.ServiceModel.Description.ServiceEndpoint $contractDescription
$channelFactory = New-Object "System.ServiceModel.ChannelFactory``1[Iinterface]" $serviceEndpoint

My interface is stored in a separate assembly that I have Add-Typed. What is puzzling me is that this

    $contractDescription = [System.ServiceModel.Description.ContractDescription]::GetContract([Iinterface])

is working just fine, but

    $channelFactory = New-Object "System.ServiceModel.ChannelFactory``1[Iinterface]" $serviceEndpoint

is failing with:

New-Object : Cannot find type [System.ServiceModel.ChannelFactory`1[Iinterface]]: make sure the assembly containing this type is loaded.
At C:\Users\amarchuk\AppData\Local\Temp\1\bbc2b1ab-fe3a-4982-a561-2bfe926b7362.ps1:29 char:29
+ $channelFactory = New-Object <<<< “System.ServiceModel.ChannelFactory“1[Iinterface]” $serviceEndpoint
+ CategoryInfo : InvalidType: (:) [New-Object], PSArgumentException
+ FullyQualifiedErrorId : TypeNotFound,Microsoft.PowerShell.Commands.NewObjectCommand

Did I mess up syntax around generics?
Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T09:17:05+00:00Added an answer on June 12, 2026 at 9:17 am

    The workaround is to use

    $channelFactory = New-Object 'System.ServiceModel.ChannelFactory``1[System.Object]
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

am trying to create WCF client to consume the service, which contains messages. So
I'm trying to follow a guide from http://kellabyte.com/2010/11/13/building-extensible-wcf-service-interfaces-with-datacontractresolver/ to create and attach a DataContractSerializer.
I'm trying to create a client for a WCF service that I have hosted
I'm trying to create a web service client using CXF to consume a WCF
I am new to wcf and trying to create a webservice from a client
I am trying to consume an ASMX web service from my WCF service. Here
I'm trying to create a simple WCF Client (C#) for a web service hosted
I am trying to create a common service library shared between a WCF web
I am trying to create a WCF client that operates with an http rest
I'm trying to create a WCF client to send XML messages to a CGI

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.