<commit_before>---
title: Getting Started with ServiceMatrix 2.0 - Send and Receive
summary: 'Getting Started with ServiceMatrix 2.0 and a send and receive example.'
tags:
- ServiceMatrix
- Send and Receive
- Visual Studio
---

ServiceMatrix is a Visual Studio integrated development environment for developing the NServiceBus distributed system.

This step-by-step guide will walk you through the creation of a send-and-receive NServiceBus distributed application using ServiceMatrix v2.0 for Visual Studio 2012, using the following steps:

1.  [Installing ServiceMatrix](#installing-servicematrix-for-visual-studio-2012)
2.  [Creating a New Project](#creating-a-new-project)
3.  [Creating Endpoints](#creating-endpoints)
4.  [Creating Services](#creating-services)
5.  [Deploying Components](#deploying-components)
6.  [Sending a Message](#sending-a-message)
7.  [Running the Application](#running-the-application)
8.  [Next Steps](#next-steps)

The example demonstrates the integration of an online sales web store with a backend system using the request-response pattern and NServiceBus.

##Installing ServiceMatrix for Visual Studio 2012
For this example you need to meet the following system requirements:
- Visual Studio 2012
- ASP.NET MVC 4 ([http://www.asp.net/downloads](http://www.asp.net/downloads))

To download and install ServiceMatrix follow the instructions [here](installing-servicematrix-2.0.md "Installing ServiceMatrix").  This document reviews the use of ServiceMatrix for Visual Studio 2012.

**NOTE**: If you have both Visual Studio 2010 and Visual Studio 2012 installed on your machine, you can install ServiceMatrix for one Visual Studio version only. This document reviews the use of ServiceMatrix v2.0 for Visual Studio 2012.

## Creating a New Project
To get started with ServiceMatrix, create a new project.
### Create an NServiceBus project
In Visual Studio select `File\New\Project` and Select 'NServiceBus System' under the Visual C\# project type. Target the .NET Framework 4.5 for this project. 

![NewProject](images/servicematrix-reqresp-newproject.png)

In the Solution name, type 'OnlineSales' (or any other name) for the name of your application.
### Review The Solution
You'll see that a solution folder has been created for your solution, as shown. 

![New Solution](images/servicematrix-reqresp-freshsolution.png)

A number of projects have been created for you, as shown in the Solution Explorer pane. The `Solution Items` folder is part of the ServiceMatrix infrastructure.

Two important folders are the `Contract` and `InternalMessages` projects as they are where all message types are placed:
-   All defined events will be put in the `Contract` project.
-   All commands will be put in the `InternalMessages` project. 

Later you will see how messages from different services are partitioned in these projects. 

Take a look at the design environment. The [Solution Builder](images/servicematrix-solutionbuilder.png "Solution Builder") on the left provides a hierarchy of the logical elements of the solution. If you  don't see a docked window in Visual Studio called Solution Builder,  open it via the View menu.

You should see folders in Solution Builder called 'Infrastructure', 'Libraries', 'Endpoints', and 'Services'.
-   Infrastructure is where cross-cutting concerns like authentication and auditing are handled.
-   Libraries are units of code that can be reused, including logging and data access.<commit_msg>SM will usually be installed using the PI, acknowledge that<commit_after>---
title: Getting Started with ServiceMatrix 2.0 - Send and Receive
summary: 'Getting Started with ServiceMatrix 2.0 and a send and receive example.'
tags:
- ServiceMatrix
- Send and Receive
- Visual Studio
---

ServiceMatrix is a Visual Studio integrated development environment for developing the NServiceBus distributed system.

This step-by-step guide will walk you through the creation of a send-and-receive NServiceBus distributed application using ServiceMatrix v2.0 for Visual Studio 2012, using the following steps:

1.  [Installing ServiceMatrix](#installing-servicematrix-for-visual-studio-2012)
2.  [Creating a New Project](#creating-a-new-project)
3.  [Creating Endpoints](#creating-endpoints)
4.  [Creating Services](#creating-services)
5.  [Deploying Components](#deploying-components)
6.  [Sending a Message](#sending-a-message)
7.  [Running the Application](#running-the-application)
8.  [Next Steps](#next-steps)

The example demonstrates the integration of an online sales web store with a backend system using the request-response pattern and NServiceBus.

## Installing ServiceMatrix for Visual Studio 2012

This document reviews the use of ServiceMatrix for Visual Studio 2012, assuming ServiceMatrix has already been installed.

ServiceMatrix can be installed using the Particular Platform Installer. To download and install ServiceMatrix separately follow the instructions [here](installing-servicematrix-2.0.md "Installing ServiceMatrix").

For this example you need to meet the following system requirements:
- Visual Studio 2012
- ASP.NET MVC 4 ([http://www.asp.net/downloads](http://www.asp.net/downloads))

**NOTE**: If you have both Visual Studio 2010 and Visual Studio 2012 installed on your machine, you can install ServiceMatrix for one Visual Studio version only. This document reviews the use of ServiceMatrix v2.0 for Visual Studio 2012.

## Creating a New Project
To get started with ServiceMatrix, create a new project.
### Create an NServiceBus project
In Visual Studio select `File\New\Project` and Select 'NServiceBus System' under the Visual C\# project type. Target the .NET Framework 4.5 for this project. 

![NewProject](images/servicematrix-reqresp-newproject.png)

In the Solution name, type 'OnlineSales' (or any other name) for the name of your application.
### Review The Solution
You'll see that a solution folder has been created for your solution, as shown. 

![New Solution](images/servicematrix-reqresp-freshsolution.png)

A number of projects have been created for you, as shown in the Solution Explorer pane. The `Solution Items` folder is part of the ServiceMatrix infrastructure.

Two important folders are the `Contract` and `InternalMessages` projects as they are where all message types are placed:
-   All defined events will be put in the `Contract` project.
-   All commands will be put in the `InternalMessages` project. 

Later you will see how messages from different services are partitioned in these projects. 

Take a look at the design environment. The [Solution Builder](images/servicematrix-solutionbuilder.png "Solution Builder") on the left provides a hierarchy of the logical elements of the solution. If you  don't see a docked window in Visual Studio called Solution Builder,  open it via the View menu.

You should see folders in Solution Builder called 'Infrastructure', 'Libraries', 'Endpoints', and 'Services'.
-   Infrastructure is where cross-cutting concerns like authentication and auditing are handled.
-   Libraries are units of code that can be reused, including logging and data access.
{'fraction_non_alphanumeric': 0.0678370786516854, 'fraction_numerical': 0.014887640449438203, 'mean_word_length': 4.860905349794239, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7486631', 'n_tokens_mistral': 1896, 'n_tokens_neox': 1735, 'n_words': 898}