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 477007
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T00:32:51+00:00 2026-05-13T00:32:51+00:00

I have a WCF server that is a library assembly. (I am writing it

  • 0

I have a WCF server that is a library assembly. (I am writing it so I can mock the level below it) It is called var a client helper class that is in a different assembly. As the data that is transferred is complex and the server has to send call-backs to the clients I wish to test the WCF code in isolation.

(I am only interested in the TCP channel or NamePipe channel)

I do not wish to mock WCF, as the risk I am trying to control is my usage of WCF.

It there a easy way to

  • Load my WCF server into a different app domain
    (I could load the WCF server into the main app domain, but then I it harder to prove that the objects were serialized correctly rather than just pointer moved about.)
  • Setup all the WCF config so the client class can call it (most likely named pipes or TCP)
  • And use it in some nunit test
  • I rather not have my unit tests depending on config file.

I expect (hope) that there are some util classes for setting up WCF unit test that I can just pass the type of my server class to and will give me back a client factory that connects to the server.

Am I going about this the wrong way, e.g there a better way of testing my communication layer and usage of WCF?

  • 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-05-13T00:32:52+00:00Added an answer on May 13, 2026 at 12:32 am

    It is by far the easiest approach if you spin up the service in-proc, because then you don’t need to write a lot of complex synchronization code to determine when the service is running and when it isn’t.

    Don’t worry about pointers being passed around – they won’t (unless you choose the new in-proc binding in WCF 4). It’s the binding that determines how and if objects are serialized. Named pipes are excellent for this purpose.

    I always spin up a new ServiceHost in each test case inside a using statement, which effectively guarantees that the host is running before calls are being made to it, and that it is properly closed after each test. This last part is important because it ensures test independence.

    You may also want to look at a series of blog posts I wrote about a very similar subject.

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

Sidebar

Related Questions

I have a WCF Library Project that connects to SQL server and the connection
I have WCF Class library, WCF Service Client and WCF Service Server in one
I have created WCF client/ server applications using calculator demo as mentioned in http://msdn.microsoft.com/en-us/library/ms734712.aspx
I have a WCF server that I can run as a service or as
I have a non-wcf server that I call from WCF client and I need
I have a WCF server library and client[Winform], i launch the server using a
Introduction : I have a Server [ WCF service library ] and Client [
I have a very simple wcf server. When a client uses an operation contract,
I have a WCF service as part of a client/server application I am working
I have a client app and a server app. The client calls a wcf

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.