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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T13:30:36+00:00 2026-05-27T13:30:36+00:00

I start the NServisBus.host.exe file from my wpf application using the following code: System.Diagnostics.Process.Start(NServiceBus.Host.exe);

  • 0

I start the NServisBus.host.exe file from my wpf application using the following code:

System.Diagnostics.Process.Start("NServiceBus.Host.exe");

I have the following endpoint settings for my NServiceBus host:

public class EndpointConfig : IConfigureThisEndpoint, AsA_Server  
{
}

I have the following class on my NServiceBus host server. I need to create this class object in my wpf application (after the NServiceBus.host.exe has been executed).

public class OrderMessaging 
{
    public IBus Bus { get; set; }

    public void SendRouteMessageReceived(LabRoutingUpdateMessage routingUpdateMessage)
    {
        Bus.Send(new RouteMessageReceived(routingUpdateMessage));
    }
}

I will then access this message class via it’s referenced dll file (in my wpf app), and use the following code in my wpf application to send a message to the server:

OrderManagement.OrderMessaging routeMessageReceived = new OrderManagement.OrderMessaging();
routeMessageReceived.Bus = _bus;   //Main problem is here! Wpf app does does not have handle on NServiceBus server Bus.
routeMessageReceived.SendRouteMessageReceived(_routing);

Is it possible for me to send a message to my NServiceBus.host.exe (when running using process.start) using a WPF application? Is there a way I can use custom initialization to host my own NServiceBus within my wpf app and still configure my endpoints correctly? Or is there a way I can get a handle on the Bus from within my wpf application?
Any example code is greatly appreciated. Thanks in advance!

  • 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-27T13:30:37+00:00Added an answer on May 27, 2026 at 1:30 pm

    It sounds like you want your WPF application to access the exact Bus instance in your NServiceBus.Host.exe hosted endpoint. If that’s true, it indicates that you think there is just one Bus, and this is not the case.

    The “Bus” is to your endpoints a lot like an Ethernet card is to your computer. Every computer needs an Ethernet card, and they use them to communicate with each other. In the same way, the “Bus” is like your Ethernet card. Every process has its own, and they use them to send messages to one another.

    NServiceBus.Host.exe makes hosting an endpoint simple, either from a console window, or it gives you the ability to install it as a Windows Service so that it is always running and available. You should never need to do a Process.Start(). It also makes the configuration of the Bus very simple – almost automatic. You don’t have to do the complicated Configure.With()… fluent configuration bit.

    With any other application type (Windows Console App, Windows Forms App, WPF App) you need to “host” the Bus yourself. That means doing the whole fluent configuration bit and assigning the resulting “IBus” instance to a public static variable that you can access from any part of that application. (In the NServiceBus.Host version, you don’t have to have a public static reference to the Bus because the Host creates it as a singleton, and the Dependency Injection container will insert it into any class you create that asks for it.)

    Once your WPF application and NServiceBus.Host.exe process are both started up and have initialized their respective buses, the WPF app’s Bus can send a message to the NServiceBus.Host.exe’s Bus.

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

Sidebar

Related Questions

I start a new WPF Application and paste following code to the MainWindow.xaml <Canvas>
Start a new Silverlight application... and in the code behind (in the Loaded event),
I start to write a client - server application using .net (C#) for both
I'm running NServiceBus 3.0.0 rc2 but when I start the application (as local admin)
I'm currently in the process of migrating an application that uses NServiceBus 2.6 to
I am getting the below error when i call NServiceBus.Host.exe. The issue appears to
I need to access a static property from a console application (NServiceBus selfhost) while
I start coding a small qt application to compute checksums. After the unthreaded code
I'm trying to move NServiceBus UnicastBusConfig from Web.config to (VB.NET) code and I'm having
I start build a system with distributed architecture by all applications will communication by

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.