Now we're going to create a service endpoint—a process that will host code to handle our command message:
Add a new class library project to your solution. Name the project
UserService
.Delete the
Class1.cs
file that came with the class project.From the NuGet Package Manager Console window, run this command to install the
NServiceBus.Host
package:PM> Install-Package NServiceBus.Host –ProjectName UserService
Take a look at what the host package has added to your class library. Don't worry; we'll cover this in more detail later:
References to
NServiceBus.Host.exe
andNServiceBus.Core.dll
An
App.config
fileA class named
EndpointConfig.cs
Project debug settings to execute
NServiceBus.Host.exe
when we debug
In the service project, add a reference to the UserService.Messages project you created before.
In the
EndpointConfig.cs
class that was generated, replace the textPLEASE_SELECT_ONE
withInMemoryPersistence
. You may need to add ausing NServiceBus.Persistence;
declaration to the file if you don't have a tool such as ReSharper to do it for you.