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

  • SEARCH
  • Home
  • 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 8084279
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T17:44:40+00:00 2026-06-05T17:44:40+00:00

I am having a problem creating a WCF service instance with a parameter. The

  • 0

I am having a problem creating a WCF service instance with a parameter. The situation is inside the service call I am unable to create a third-parth library COM object (there is some threading issue and this object can only be created in the main thread). As a result, I want to simply maintain a list of objects to be created inside the service function, and let the main thread do the actual object creating work.

But I am not clear how I can simply pass the list to the constructor of service instance. As little as I know of WCF, I think the service instance is created by the framework itself and it doesn’t take any parameter in the constructor. So what is the simplest way to pass this list from main thread to service instance? 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-05T17:44:41+00:00Added an answer on June 5, 2026 at 5:44 pm

    Try to play with:

    • Default constructor
    • Manual service host. Inherit from:
      • System.ServiceModel.ServiceHost
      • System.ServiceModel.Activation.ServiceHostFactory
    • ServiceBehavior.InstanceContextMode:
      • InstanceContextMode.Single, etc.
    • Class-scope fields:

      public class Service : IService
      {
          private AnotherClass _a = new AnotherClass(); // maybe static?
      }
      

      It will be instantiated before default constructor call, or anyway if you don’t have a default one

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Having a bit of a problem creating an instance of an object. Bear in
I seem to be having a problem creating new local variables inside a switch
I have a self-hosted WCF service and I'm having the following problem: 15 minutes
I am having problem creating a new directory inside my FTP using mkdir, here
Iam having problem creating postgresql function in plperl CREATE OR REPLACE FUNCTION zm_json (TEXT,
I'm creating a custom WCF service for deployment inside SharePoint 2010 following the instructions
I'm having a problem with a WCF service trying to consume it from Java.
I'm trying to create this JSON string but having problem creating it. I'm getting
I am having problems creating WCF client proxy for service code like in this
I'm having a problem creating a C# P/invoke wrapper around a third party C

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.