Skip to content
This repository was archived by the owner on Sep 2, 2021. It is now read-only.

Commit 6bc06a9

Browse files
committed
update to v7
1 parent 462a63a commit 6bc06a9

50 files changed

Lines changed: 597 additions & 993 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

GitVersion.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
assembly-versioning-scheme: Major
2+
next-version: 2.0
3+
branches:
4+
develop:
5+
tag: beta
6+
release:
7+
tag: rc

packaging/nuget/nservicebus.filebasedrouting.nuspec

Lines changed: 0 additions & 28 deletions
This file was deleted.

src/Contracts/Contracts.csproj

Lines changed: 3 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,10 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3-
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
2+
<Project Sdk="Microsoft.NET.Sdk">
43
<PropertyGroup>
5-
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6-
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7-
<ProjectGuid>{FB64C215-540A-4ED1-901F-1E0A242D0908}</ProjectGuid>
8-
<OutputType>Library</OutputType>
9-
<AppDesignerFolder>Properties</AppDesignerFolder>
10-
<RootNamespace>Contracts</RootNamespace>
11-
<AssemblyName>Contracts</AssemblyName>
12-
<TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
13-
<FileAlignment>512</FileAlignment>
14-
</PropertyGroup>
15-
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
16-
<DebugSymbols>true</DebugSymbols>
17-
<DebugType>full</DebugType>
18-
<Optimize>false</Optimize>
19-
<OutputPath>bin\Debug\</OutputPath>
20-
<DefineConstants>DEBUG;TRACE</DefineConstants>
21-
<ErrorReport>prompt</ErrorReport>
22-
<WarningLevel>4</WarningLevel>
23-
</PropertyGroup>
24-
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
25-
<DebugType>pdbonly</DebugType>
26-
<Optimize>true</Optimize>
27-
<OutputPath>bin\Release\</OutputPath>
28-
<DefineConstants>TRACE</DefineConstants>
29-
<ErrorReport>prompt</ErrorReport>
30-
<WarningLevel>4</WarningLevel>
4+
<TargetFrameworks>net452</TargetFrameworks>
315
</PropertyGroup>
326
<ItemGroup>
33-
<Reference Include="NServiceBus.Core, Version=6.0.0.0, Culture=neutral, PublicKeyToken=9fc386479f8a226c, processorArchitecture=MSIL">
34-
<HintPath>..\packages\NServiceBus.6.1.0\lib\net452\NServiceBus.Core.dll</HintPath>
35-
<Private>True</Private>
36-
</Reference>
7+
<PackageReference Include="NServiceBus" Version="7.0.0-*" />
378
<Reference Include="System" />
389
<Reference Include="System.Core" />
3910
<Reference Include="System.Xml.Linq" />
@@ -43,23 +14,4 @@
4314
<Reference Include="System.Net.Http" />
4415
<Reference Include="System.Xml" />
4516
</ItemGroup>
46-
<ItemGroup>
47-
<Compile Include="Commands\DemoCommand.cs" />
48-
<Compile Include="Events\DemoCommandReceived.cs" />
49-
<Compile Include="Events\DemoEvent.cs" />
50-
</ItemGroup>
51-
<ItemGroup>
52-
<Folder Include="Properties\" />
53-
</ItemGroup>
54-
<ItemGroup>
55-
<None Include="packages.config" />
56-
</ItemGroup>
57-
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
58-
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
59-
Other similar extension points exist, see Microsoft.Common.targets.
60-
<Target Name="BeforeBuild">
61-
</Target>
62-
<Target Name="AfterBuild">
63-
</Target>
64-
-->
6517
</Project>

src/Contracts/packages.config

Lines changed: 0 additions & 4 deletions
This file was deleted.

src/Directory.Build.props

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<Project>
2+
3+
<PropertyGroup>
4+
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
5+
<LangVersion>7.1</LangVersion>
6+
</PropertyGroup>
7+
8+
<!-- Workaround for GitVersion 4.0 not creating GitVersionInformation by default -->
9+
<PropertyGroup>
10+
<UpdateAssemblyInfo>true</UpdateAssemblyInfo>
11+
<GenerateAssemblyFileVersionAttribute>false</GenerateAssemblyFileVersionAttribute>
12+
<GenerateAssemblyInformationalVersionAttribute>false</GenerateAssemblyInformationalVersionAttribute>
13+
<GenerateAssemblyVersionAttribute>false</GenerateAssemblyVersionAttribute>
14+
</PropertyGroup>
15+
16+
<!-- Versioning workaround because of https://github.com/NuGet/Home/issues/4790 -->
17+
<PropertyGroup>
18+
<GitVersionTaskVersion>4.0.0-*</GitVersionTaskVersion>
19+
</PropertyGroup>
20+
21+
<ItemGroup>
22+
<PackageReference Include="GitVersionTask" Version="$(GitVersionTaskVersion)" PrivateAssets="All" />
23+
</ItemGroup>
24+
25+
<ImportGroup Condition="'$(ExcludeRestorePackageImports)' == 'true' And '$(MSBuildRuntimeType)' != 'Core'">
26+
<Import
27+
Project="$(UserProfile)\.nuget\packages\gitversiontask\$(GitVersionTaskVersion)\buildMultiTargeting\GitVersionTask.targets"
28+
Condition="Exists('$(UserProfile)\.nuget\packages\gitversiontask\$(GitVersionTaskVersion)\buildMultiTargeting\GitVersionTask.targets')" />
29+
</ImportGroup>
30+
<Target
31+
Name="FixUpVersion"
32+
BeforeTargets="_GenerateRestoreProjectSpec"
33+
DependsOnTargets="GetVersion"
34+
Condition="'$(GitVersion_Task_targets_Imported)' == 'True'" />
35+
36+
</Project>

src/Directory.Build.targets

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<Project>
2+
3+
<PropertyGroup>
4+
<Authors>NServiceBus Ltd</Authors>
5+
<Company>NServiceBus Ltd</Company>
6+
<PackageLicenseUrl>http://particular.net/LicenseAgreement</PackageLicenseUrl>
7+
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
8+
<Copyright>Copyright 2010-$([System.DateTime]::UtcNow.ToString(yyyy)) NServiceBus. All rights reserved</Copyright>
9+
<PackageTags>nservicebus servicebus msmq cqrs publish subscribe</PackageTags>
10+
<PackageIconUrl>http://s3.amazonaws.com/nuget.images/NServiceBus_32.png</PackageIconUrl>
11+
<PackageProjectUrl>https://docs.particular.net/nuget/$(PackageId)</PackageProjectUrl>
12+
<PackageOutputPath>..\..\nugets</PackageOutputPath>
13+
<TargetsForTfmSpecificContentInPackage>$(TargetsForTfmSpecificContentInPackage);IncludePDBsInPackage</TargetsForTfmSpecificContentInPackage>
14+
</PropertyGroup>
15+
16+
<Target Name="IncludePDBsInPackage" Condition="'$(IncludeBuildOutput)' != 'false'">
17+
<ItemGroup>
18+
<TfmSpecificPackageFile Include="$(OutputPath)\$(AssemblyName).pdb" PackagePath="lib/$(TargetFramework)" />
19+
</ItemGroup>
20+
</Target>
21+
22+
</Project>

src/EndpointA/App.config

Lines changed: 0 additions & 6 deletions
This file was deleted.

src/EndpointA/DemoCommandReceivedHandler.cs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,11 @@
33
using Contracts.Events;
44
using NServiceBus;
55

6-
namespace EndpointA
6+
public class DemoCommandReceivedHandler : IHandleMessages<DemoCommandReceived>
77
{
8-
public class DemoCommandReceivedHandler : IHandleMessages<DemoCommandReceived>
8+
public Task Handle(DemoCommandReceived message, IMessageHandlerContext context)
99
{
10-
public Task Handle(DemoCommandReceived message, IMessageHandlerContext context)
11-
{
12-
Console.WriteLine($"Received {nameof(DemoCommandReceived)} for command {message.ReceivedCommandId}");
13-
return Task.CompletedTask;
14-
}
10+
Console.WriteLine($"Received {nameof(DemoCommandReceived)} for command {message.ReceivedCommandId}");
11+
return Task.FromResult(0);
1512
}
1613
}

src/EndpointA/EndpointA.csproj

Lines changed: 6 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,12 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3-
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
2+
<Project Sdk="Microsoft.NET.Sdk">
43
<PropertyGroup>
5-
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6-
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7-
<ProjectGuid>{8B25A222-B70F-490C-8EF4-E8B788563176}</ProjectGuid>
4+
<TargetFrameworks>net452</TargetFrameworks>
85
<OutputType>Exe</OutputType>
9-
<AppDesignerFolder>Properties</AppDesignerFolder>
10-
<RootNamespace>EndpointA</RootNamespace>
11-
<AssemblyName>EndpointA</AssemblyName>
12-
<TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
13-
<FileAlignment>512</FileAlignment>
14-
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
15-
</PropertyGroup>
16-
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
17-
<PlatformTarget>AnyCPU</PlatformTarget>
18-
<DebugSymbols>true</DebugSymbols>
19-
<DebugType>full</DebugType>
20-
<Optimize>false</Optimize>
21-
<OutputPath>bin\Debug\</OutputPath>
22-
<DefineConstants>DEBUG;TRACE</DefineConstants>
23-
<ErrorReport>prompt</ErrorReport>
24-
<WarningLevel>4</WarningLevel>
25-
</PropertyGroup>
26-
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
27-
<PlatformTarget>AnyCPU</PlatformTarget>
28-
<DebugType>pdbonly</DebugType>
29-
<Optimize>true</Optimize>
30-
<OutputPath>bin\Release\</OutputPath>
31-
<DefineConstants>TRACE</DefineConstants>
32-
<ErrorReport>prompt</ErrorReport>
33-
<WarningLevel>4</WarningLevel>
346
</PropertyGroup>
357
<ItemGroup>
36-
<Reference Include="NServiceBus.Core, Version=6.0.0.0, Culture=neutral, PublicKeyToken=9fc386479f8a226c, processorArchitecture=MSIL">
37-
<HintPath>..\packages\NServiceBus.6.1.0\lib\net452\NServiceBus.Core.dll</HintPath>
38-
<Private>True</Private>
39-
</Reference>
8+
<PackageReference Include="NServiceBus" Version="7.0.0-*" />
9+
<PackageReference Include="NServiceBus.Transport.Msmq" Version="1.0.0-*" />
4010
<Reference Include="System" />
4111
<Reference Include="System.Core" />
4212
<Reference Include="System.Xml.Linq" />
@@ -45,42 +15,7 @@
4515
<Reference Include="System.Data" />
4616
<Reference Include="System.Net.Http" />
4717
<Reference Include="System.Xml" />
18+
<ProjectReference Include="..\Contracts\Contracts.csproj" />
19+
<ProjectReference Include="..\NServiceBus.FileBasedRouting\NServiceBus.FileBasedRouting.csproj" />
4820
</ItemGroup>
49-
<ItemGroup>
50-
<Compile Include="DemoCommandReceivedHandler.cs" />
51-
<Compile Include="Program.cs" />
52-
</ItemGroup>
53-
<ItemGroup>
54-
<None Include="App.config" />
55-
<None Include="packages.config" />
56-
</ItemGroup>
57-
<ItemGroup>
58-
<ProjectReference Include="..\Contracts\Contracts.csproj">
59-
<Project>{fb64c215-540a-4ed1-901f-1e0a242d0908}</Project>
60-
<Name>Contracts</Name>
61-
</ProjectReference>
62-
<ProjectReference Include="..\NServiceBus.FileBasedRouting\NServiceBus.FileBasedRouting.csproj">
63-
<Project>{b6417ca5-3892-4c53-8356-31018692ae35}</Project>
64-
<Name>NServiceBus.FileBasedRouting</Name>
65-
</ProjectReference>
66-
</ItemGroup>
67-
<ItemGroup>
68-
<Content Include="endpoints.xml">
69-
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
70-
</Content>
71-
<Content Include="instance-mapping.xml">
72-
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
73-
</Content>
74-
</ItemGroup>
75-
<ItemGroup>
76-
<Folder Include="Properties\" />
77-
</ItemGroup>
78-
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
79-
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
80-
Other similar extension points exist, see Microsoft.Common.targets.
81-
<Target Name="BeforeBuild">
82-
</Target>
83-
<Target Name="AfterBuild">
84-
</Target>
85-
-->
8621
</Project>

src/EndpointA/Program.cs

Lines changed: 43 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -5,57 +5,61 @@
55
using NServiceBus;
66
using NServiceBus.FileBasedRouting;
77

8-
namespace EndpointA
8+
class Program
99
{
10-
class Program
10+
static async Task Main()
1111
{
12-
static void Main(string[] args)
13-
{
14-
AsyncMain().GetAwaiter().GetResult();
15-
}
16-
17-
static async Task AsyncMain()
18-
{
19-
var endpointConfiguration = new EndpointConfiguration("endpointA");
12+
var endpointConfiguration = new EndpointConfiguration("endpointA");
2013

21-
endpointConfiguration.UsePersistence<InMemoryPersistence>();
22-
endpointConfiguration.SendFailedMessagesTo("error");
14+
endpointConfiguration.UsePersistence<InMemoryPersistence>();
15+
endpointConfiguration.SendFailedMessagesTo("error");
2316

24-
var routingConfig = endpointConfiguration.UseTransport<MsmqTransport>().Routing();
25-
routingConfig.RegisterPublisher(typeof(DemoCommandReceived), "endpointB");
26-
routingConfig.InstanceMappingFile().FilePath("instance-mapping.xml");
27-
routingConfig.UseFileBasedRouting();
17+
var routingConfig = endpointConfiguration.UseTransport<MsmqTransport>().Routing();
18+
routingConfig.RegisterPublisher(typeof(DemoCommandReceived), "endpointB");
19+
routingConfig.InstanceMappingFile().FilePath("instance-mapping.xml");
20+
routingConfig.UseFileBasedRouting();
2821

29-
var endpoint = await Endpoint.Start(endpointConfiguration);
22+
var endpoint = await Endpoint.Start(endpointConfiguration)
23+
.ConfigureAwait(false);
3024

31-
Console.WriteLine("Press [c] to send a command. Press [e] to publish an event. Press [Esc] to quit.");
25+
Console.WriteLine("Press [c] to send a command. Press [e] to publish an event. Press [Esc] to quit.");
3226

33-
while (true)
27+
while (true)
28+
{
29+
var key = Console.ReadKey();
30+
if (key.Key == ConsoleKey.Escape)
3431
{
35-
var key = Console.ReadKey();
36-
if (key.Key == ConsoleKey.Escape)
37-
{
38-
break;
39-
}
32+
break;
33+
}
4034

41-
if (key.Key == ConsoleKey.C)
35+
if (key.Key == ConsoleKey.C)
36+
{
37+
var commandId = Guid.NewGuid();
38+
var demoCommand = new DemoCommand
4239
{
43-
var commandId = Guid.NewGuid();
44-
await endpoint.Send(new DemoCommand { CommandId = commandId });
45-
Console.WriteLine();
46-
Console.WriteLine("Sent command with id: " + commandId);
47-
}
40+
CommandId = commandId
41+
};
42+
await endpoint.Send(demoCommand)
43+
.ConfigureAwait(false);
44+
Console.WriteLine();
45+
Console.WriteLine("Sent command with id: " + commandId);
46+
}
4847

49-
if (key.Key == ConsoleKey.E)
48+
if (key.Key == ConsoleKey.E)
49+
{
50+
var eventId = Guid.NewGuid();
51+
var demoEvent = new DemoEvent
5052
{
51-
var eventId = Guid.NewGuid();
52-
await endpoint.Publish(new DemoEvent() { EventId = eventId });
53-
Console.WriteLine();
54-
Console.WriteLine("Sent event with id: " + eventId);
55-
}
53+
EventId = eventId
54+
};
55+
await endpoint.Publish(demoEvent)
56+
.ConfigureAwait(false);
57+
Console.WriteLine();
58+
Console.WriteLine("Sent event with id: " + eventId);
5659
}
57-
58-
await endpoint.Stop();
5960
}
61+
62+
await endpoint.Stop()
63+
.ConfigureAwait(false);
6064
}
61-
}
65+
}

0 commit comments

Comments
 (0)