diff --git a/.gitignore b/.gitignore
index 81e89fb6c01..1a2e20de589 100644
--- a/.gitignore
+++ b/.gitignore
@@ -35,4 +35,3 @@ _NCrunch_NServiceBus/*
logs
run-git.cmd
src/Chocolatey/Build/*
-App_Packages
diff --git a/buildsupport/GitVersionTask/Build/GitVersionTask.targets b/buildsupport/GitVersionTask/Build/GitVersionTask.targets
index d88232f594a..9fc759ae1c0 100644
--- a/buildsupport/GitVersionTask/Build/GitVersionTask.targets
+++ b/buildsupport/GitVersionTask/Build/GitVersionTask.targets
@@ -3,46 +3,73 @@
$(MSBuildProjectDirectory)..\
+
+ false
+
+
-
-
+
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
diff --git a/buildsupport/GitVersionTask/GitVersion.exe b/buildsupport/GitVersionTask/GitVersion.exe
deleted file mode 100644
index 8145ba7ede6..00000000000
Binary files a/buildsupport/GitVersionTask/GitVersion.exe and /dev/null differ
diff --git a/buildsupport/GitVersionTask/GitVersionTask.dll b/buildsupport/GitVersionTask/GitVersionTask.dll
index 035d8acd570..cb27d44c58e 100644
Binary files a/buildsupport/GitVersionTask/GitVersionTask.dll and b/buildsupport/GitVersionTask/GitVersionTask.dll differ
diff --git a/buildsupport/GitVersionTask/LibGit2Sharp.dll b/buildsupport/GitVersionTask/LibGit2Sharp.dll
deleted file mode 100644
index a8e940c4bfa..00000000000
Binary files a/buildsupport/GitVersionTask/LibGit2Sharp.dll and /dev/null differ
diff --git a/buildsupport/GitVersionTask/NativeBinaries/amd64/git2-65e9dc6.dll b/buildsupport/GitVersionTask/NativeBinaries/amd64/git2-65e9dc6.dll
deleted file mode 100644
index d548c861ee8..00000000000
Binary files a/buildsupport/GitVersionTask/NativeBinaries/amd64/git2-65e9dc6.dll and /dev/null differ
diff --git a/buildsupport/GitVersionTask/NativeBinaries/amd64/git2-69db893.dll b/buildsupport/GitVersionTask/NativeBinaries/amd64/git2-69db893.dll
new file mode 100644
index 00000000000..1b43954467e
Binary files /dev/null and b/buildsupport/GitVersionTask/NativeBinaries/amd64/git2-69db893.dll differ
diff --git a/buildsupport/GitVersionTask/NativeBinaries/amd64/git2-90befde.dll b/buildsupport/GitVersionTask/NativeBinaries/amd64/git2-90befde.dll
new file mode 100644
index 00000000000..5af4cbce4d8
Binary files /dev/null and b/buildsupport/GitVersionTask/NativeBinaries/amd64/git2-90befde.dll differ
diff --git a/buildsupport/GitVersionTask/NativeBinaries/x86/git2-65e9dc6.dll b/buildsupport/GitVersionTask/NativeBinaries/x86/git2-65e9dc6.dll
deleted file mode 100644
index 040f87c75dd..00000000000
Binary files a/buildsupport/GitVersionTask/NativeBinaries/x86/git2-65e9dc6.dll and /dev/null differ
diff --git a/buildsupport/GitVersionTask/NativeBinaries/x86/git2-69db893.dll b/buildsupport/GitVersionTask/NativeBinaries/x86/git2-69db893.dll
new file mode 100644
index 00000000000..4295b98eb61
Binary files /dev/null and b/buildsupport/GitVersionTask/NativeBinaries/x86/git2-69db893.dll differ
diff --git a/buildsupport/GitVersionTask/NativeBinaries/x86/git2-90befde.dll b/buildsupport/GitVersionTask/NativeBinaries/x86/git2-90befde.dll
new file mode 100644
index 00000000000..086bfda98ac
Binary files /dev/null and b/buildsupport/GitVersionTask/NativeBinaries/x86/git2-90befde.dll differ
diff --git a/buildsupport/NuGet.Core.dll b/buildsupport/NuGet.Core.dll
index a5787205f1f..390e4e025ac 100644
Binary files a/buildsupport/NuGet.Core.dll and b/buildsupport/NuGet.Core.dll differ
diff --git a/buildsupport/RippleRestoreTask.dll b/buildsupport/RippleRestoreTask.dll
index e443473c54c..e84e8b68bf4 100644
Binary files a/buildsupport/RippleRestoreTask.dll and b/buildsupport/RippleRestoreTask.dll differ
diff --git a/buildsupport/ripple.exe b/buildsupport/ripple.exe
index 5ed129f4cc6..457ae8a9e94 100644
Binary files a/buildsupport/ripple.exe and b/buildsupport/ripple.exe differ
diff --git a/ripple.config b/ripple.config
index 572d4910123..b8acf258f1e 100644
--- a/ripple.config
+++ b/ripple.config
@@ -9,7 +9,7 @@
Current,NextMajor
-
+
@@ -28,7 +28,7 @@
-
+
@@ -58,4 +58,4 @@
-
\ No newline at end of file
+
diff --git a/src/NServiceBus.AcceptanceTests/BasicMessaging/When_handling_current_message_later.cs b/src/NServiceBus.AcceptanceTests/BasicMessaging/When_handling_current_message_later.cs
index 00420aed991..fcdf9301ee3 100644
--- a/src/NServiceBus.AcceptanceTests/BasicMessaging/When_handling_current_message_later.cs
+++ b/src/NServiceBus.AcceptanceTests/BasicMessaging/When_handling_current_message_later.cs
@@ -55,7 +55,7 @@ public void Handlers_are_executed_in_the_right_order()
"ThirdHandler:Executed",
"FirstHandler:Executed",
"SecondHandler:Handling the message this time",
- "ThirdHandler:Executed",
+ "ThirdHandler:Executed"
},
events);
}
diff --git a/src/NServiceBus.Core.Tests/AssemblyScanner/AssemblyScannerTests.cs b/src/NServiceBus.Core.Tests/AssemblyScanner/AssemblyScannerTests.cs
index 5fb8e87ff5f..b32bf840be2 100644
--- a/src/NServiceBus.Core.Tests/AssemblyScanner/AssemblyScannerTests.cs
+++ b/src/NServiceBus.Core.Tests/AssemblyScanner/AssemblyScannerTests.cs
@@ -240,7 +240,7 @@ public void non_dotnet_files_are_skipped()
"libzmq-v120-mt-3_2_3.dll",
"Tail.exe",
"some_random.dll",
- "some_random.exe",
+ "some_random.exe"
};
foreach (var notProperDll in notProperDotNetDlls)
diff --git a/src/NServiceBus.Core.Tests/AttributeTests.cs b/src/NServiceBus.Core.Tests/AttributeTests.cs
index 73ea56e3081..8bbd9160c68 100644
--- a/src/NServiceBus.Core.Tests/AttributeTests.cs
+++ b/src/NServiceBus.Core.Tests/AttributeTests.cs
@@ -27,10 +27,11 @@ static IEnumerable GetAttributeTypes(Assembly assembly)
{
return assembly.GetTypes()
.Where(type =>
+ (type.Namespace != null) &&
typeof(Attribute).IsAssignableFrom(type) &&
//Ignore log4net attributes
!type.Namespace.Contains("log4net") &&
- //Ignore Newtonsoft attributes
+ //Ignore Newtonsoft attributes
!type.Namespace.Contains("Newtonsoft") &&
//TODO: remove when gitversion is updated
!type.Name.EndsWith("ReleaseDateAttribute") &&
diff --git a/src/NServiceBus.Core.Tests/Fakes/FakeBus.cs b/src/NServiceBus.Core.Tests/Fakes/FakeBus.cs
index 32067173f92..afa8cc93402 100644
--- a/src/NServiceBus.Core.Tests/Fakes/FakeBus.cs
+++ b/src/NServiceBus.Core.Tests/Fakes/FakeBus.cs
@@ -283,7 +283,5 @@ public IBus Start()
{
throw new NotImplementedException();
}
-
- public event EventHandler Started;
}
}
\ No newline at end of file
diff --git a/src/NServiceBus.Core.Tests/NServiceBusVersionTests.cs b/src/NServiceBus.Core.Tests/NServiceBusVersionTests.cs
index 158dcc13af3..2f5a0e606b1 100644
--- a/src/NServiceBus.Core.Tests/NServiceBusVersionTests.cs
+++ b/src/NServiceBus.Core.Tests/NServiceBusVersionTests.cs
@@ -1,5 +1,6 @@
namespace NServiceBus
{
+ using System;
using NUnit.Framework;
[TestFixture]
@@ -9,6 +10,11 @@ public class NServiceBusVersionTests
public void Verify_has_a_version_and_can_be_parsed()
{
Assert.IsNotNullOrEmpty(NServiceBusVersion.Version);
+ Version.Parse(NServiceBusVersion.Version);
+ Assert.IsNotNullOrEmpty(GitFlowVersion.MajorMinor);
+ Version.Parse(GitFlowVersion.MajorMinor);
+ Assert.IsNotNullOrEmpty(GitFlowVersion.MajorMinorPatch);
+ Version.Parse(GitFlowVersion.MajorMinorPatch);
}
}
}
\ No newline at end of file
diff --git a/src/NServiceBus.Core.Tests/Unicast/DeferedMessages.cs b/src/NServiceBus.Core.Tests/Unicast/DeferedMessages.cs
index b08eea5651f..cba76c90807 100644
--- a/src/NServiceBus.Core.Tests/Unicast/DeferedMessages.cs
+++ b/src/NServiceBus.Core.Tests/Unicast/DeferedMessages.cs
@@ -2,6 +2,7 @@
{
using System;
using Contexts;
+ using NServiceBus.Settings;
using NUnit.Framework;
using Timeout;
@@ -20,6 +21,29 @@ public void Should_use_a_convention_to_set_the_address()
}
}
+
+ [TestFixture]
+ public class When_deferring_a_message_when_involving_worker : using_the_unicastBus
+ {
+ [Test]
+ public void Should_use_master_node_address_when_worker_is_enabled()
+ {
+ SettingsHolder.SetDefault("Worker.Enabled", true);
+ RegisterMessageType();
+ bus.Defer(TimeSpan.FromDays(1), new DeferredMessage());
+ VerifyThatMessageWasSentWithHeaders(h => h["NServiceBus.Timeout.RouteExpiredTimeoutTo"] == MasterNodeAddress.ToString());
+ }
+
+ [Test]
+ public void Should_use_local_address_when_worker_is_disabled()
+ {
+ SettingsHolder.SetDefault("Worker.Enabled", false);
+ RegisterMessageType();
+ bus.Defer(TimeSpan.FromDays(1), new DeferredMessage());
+ VerifyThatMessageWasSentWithHeaders(h => h["NServiceBus.Timeout.RouteExpiredTimeoutTo"] == Address.Local.ToString());
+ }
+ }
+
[TestFixture]
public class When_deferring_a_message_with_a_set_delay : using_the_unicastBus
{
diff --git a/src/NServiceBus.Core.Tests/Unicast/HandlerInvocationCache.cs b/src/NServiceBus.Core.Tests/Unicast/HandlerInvocationCache.cs
index 588040d658e..6ab8b5b2ec1 100644
--- a/src/NServiceBus.Core.Tests/Unicast/HandlerInvocationCache.cs
+++ b/src/NServiceBus.Core.Tests/Unicast/HandlerInvocationCache.cs
@@ -44,14 +44,10 @@ public class StubMessage
public class StubTimeoutHandler : IHandleTimeouts
{
- public bool TimeoutCalled;
- public StubTimeoutState HandledState;
-
+
public void Timeout(StubTimeoutState state)
{
- TimeoutCalled = true;
- HandledState = state;
}
}
diff --git a/src/NServiceBus.Core.Tests/Unicast/Receiving.cs b/src/NServiceBus.Core.Tests/Unicast/Receiving.cs
index e97261c5784..8a823014242 100644
--- a/src/NServiceBus.Core.Tests/Unicast/Receiving.cs
+++ b/src/NServiceBus.Core.Tests/Unicast/Receiving.cs
@@ -481,11 +481,9 @@ public void Handle(EventMessage message)
class CheckMessageIdHandler : IHandleMessages
{
- public static bool Called;
public void Handle(EventMessage message)
{
- Called = true;
}
}
diff --git a/src/NServiceBus.Core/App_Packages/Particular.Licensing/License.cs b/src/NServiceBus.Core/App_Packages/Particular.Licensing/License.cs
new file mode 100644
index 00000000000..fba1325d01f
--- /dev/null
+++ b/src/NServiceBus.Core/App_Packages/Particular.Licensing/License.cs
@@ -0,0 +1,51 @@
+namespace Particular.Licensing
+{
+ using System;
+ using System.Collections.Generic;
+
+ class License
+ {
+ public static License TrialLicense(DateTime trialStartDate)
+ {
+ return new License
+ {
+ LicenseType = "Trial",
+ ExpirationDate = trialStartDate.AddDays(14),
+ IsExtendedTrial = false,
+ ValidApplications = new List { "All"}
+ };
+ }
+
+ public License()
+ {
+ ValidApplications = new List();
+ }
+
+ public DateTime? ExpirationDate { get; set; }
+
+ public bool IsTrialLicense
+ {
+ get { return !IsCommercialLicense; }
+ }
+
+ public bool IsExtendedTrial { get; set; }
+
+ public bool IsCommercialLicense
+ {
+ get { return LicenseType.ToLower() != "trial"; }
+ }
+
+ public string LicenseType { get; set; }
+
+ public string RegisteredTo { get; set; }
+
+ public DateTime? UpgradeProtectionExpiration { get; internal set; }
+
+ public List ValidApplications{ get; internal set; }
+
+ public bool ValidForApplication(string applicationName)
+ {
+ return ValidApplications.Contains(applicationName) || ValidApplications.Contains("All");
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/NServiceBus.Core/App_Packages/Particular.Licensing/LicenseDeserializer.cs b/src/NServiceBus.Core/App_Packages/Particular.Licensing/LicenseDeserializer.cs
new file mode 100644
index 00000000000..37b4f75e727
--- /dev/null
+++ b/src/NServiceBus.Core/App_Packages/Particular.Licensing/LicenseDeserializer.cs
@@ -0,0 +1,74 @@
+namespace Particular.Licensing
+{
+ using System;
+ using System.Linq;
+ using System.Xml;
+
+ static class LicenseDeserializer
+ {
+ public static License Deserialize(string licenseText)
+ {
+ var license = new License();
+ var doc = new XmlDocument();
+ doc.LoadXml(licenseText);
+
+
+ var applications = doc.SelectSingleNode("/license/@Applications");
+
+
+ if (applications != null)
+ {
+ license.ValidApplications.AddRange(applications.Value.Split(';'));
+ }
+
+ var upgradeProtectionExpiration = doc.SelectSingleNode("/license/@UpgradeProtectionExpiration");
+
+ if (upgradeProtectionExpiration != null)
+ {
+ license.UpgradeProtectionExpiration = Parse(upgradeProtectionExpiration.Value);
+ }
+ else
+ {
+ var expirationDate = doc.SelectSingleNode("/license/@expiration");
+
+ if (expirationDate != null)
+ {
+ license.ExpirationDate = Parse(expirationDate.Value);
+
+ }
+ }
+
+ var licenseType = doc.SelectSingleNode("/license/@LicenseType");
+
+ if (licenseType == null)
+ {
+ licenseType = doc.SelectSingleNode("/license/@type");
+ }
+
+ if (licenseType != null)
+ {
+ license.LicenseType = licenseType.Value;
+ }
+
+ var name = doc.SelectSingleNode("/license/name");
+
+ if (name != null)
+ {
+ license.RegisteredTo = name.InnerText;
+ }
+
+ return license;
+ }
+
+ static DateTime Parse(string dateStringFromLicense)
+ {
+ if (string.IsNullOrEmpty(dateStringFromLicense))
+ {
+ throw new Exception("Invalid datestring found in xml");
+ }
+
+ return UniversalDateParser.Parse(dateStringFromLicense.Split('T').First());
+ }
+
+ }
+}
\ No newline at end of file
diff --git a/src/NServiceBus.Core/App_Packages/Particular.Licensing/LicenseExpirationChecker.cs b/src/NServiceBus.Core/App_Packages/Particular.Licensing/LicenseExpirationChecker.cs
new file mode 100644
index 00000000000..2ae74998764
--- /dev/null
+++ b/src/NServiceBus.Core/App_Packages/Particular.Licensing/LicenseExpirationChecker.cs
@@ -0,0 +1,38 @@
+namespace Particular.Licensing
+{
+ using System;
+
+ static class LicenseExpirationChecker
+ {
+ public static bool HasLicenseExpired(License license)
+ {
+ if (license.ExpirationDate.HasValue && HasLicenseDateExpired(license.ExpirationDate.Value))
+ {
+ return true;
+ }
+
+
+ if (license.UpgradeProtectionExpiration != null)
+ {
+ var buildTimeStamp = ReleaseDateReader.GetReleaseDate();
+ if (buildTimeStamp > license.UpgradeProtectionExpiration)
+ {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ static bool HasLicenseDateExpired(DateTime licenseDate)
+ {
+ var oneDayGrace = licenseDate;
+
+ if (licenseDate < DateTime.MaxValue.AddDays(-1))
+ {
+ oneDayGrace = licenseDate.AddDays(1);
+ }
+
+ return oneDayGrace < DateTime.UtcNow.Date;
+ }
+ }
+}
diff --git a/src/NServiceBus.Core/App_Packages/Particular.Licensing/LicenseVerifier.cs b/src/NServiceBus.Core/App_Packages/Particular.Licensing/LicenseVerifier.cs
new file mode 100644
index 00000000000..7d33a5441a7
--- /dev/null
+++ b/src/NServiceBus.Core/App_Packages/Particular.Licensing/LicenseVerifier.cs
@@ -0,0 +1,92 @@
+namespace Particular.Licensing
+{
+ using System;
+ using System.Security.Cryptography;
+ using System.Security.Cryptography.Xml;
+ using System.Xml;
+
+ class LicenseVerifier
+ {
+ public static bool TryVerify(string licenseText, out Exception failure)
+ {
+ try
+ {
+ Verify(licenseText);
+
+ failure = null;
+
+ return true;
+ }
+ catch (Exception ex)
+ {
+ failure = ex;
+ return false;
+ }
+
+ }
+
+ public static void Verify(string licenseText)
+ {
+ if (string.IsNullOrEmpty(licenseText))
+ {
+ throw new Exception("Empty license string");
+ }
+
+ var xmlVerifier = new SignedXmlVerifier(PublicKey);
+
+ xmlVerifier.VerifyXml(licenseText);
+ }
+
+ public const string PublicKey = @"5M9/p7N+JczIN/e5eObahxeCIe//2xRLA9YTam7zBrcUGt1UlnXqL0l/8uO8rsO5tl+tjjIV9bOTpDLfx0H03VJyxsE8BEpSVu48xujvI25+0mWRnk4V50bDZykCTS3Du0c8XvYj5jIKOHPtU//mKXVULhagT8GkAnNnMj9CvTc=AQAB";
+
+ class SignedXmlVerifier
+ {
+ readonly string publicKey;
+
+ public SignedXmlVerifier(string publicKey)
+ {
+ this.publicKey = publicKey;
+ }
+
+ public void VerifyXml(string xml)
+ {
+ var doc = LoadXmlDoc(xml);
+
+ using (var rsa = new RSACryptoServiceProvider())
+ {
+ rsa.FromXmlString(publicKey);
+
+ var nsMgr = new XmlNamespaceManager(doc.NameTable);
+ nsMgr.AddNamespace("sig", "http://www.w3.org/2000/09/xmldsig#");
+
+ var signedXml = new SignedXml(doc);
+ var signature = (XmlElement)doc.SelectSingleNode("//sig:Signature", nsMgr);
+ if (signature == null)
+ {
+ throw new Exception("Xml is invalid as it has no XML signature");
+ }
+ signedXml.LoadXml(signature);
+
+ if (!signedXml.CheckSignature(rsa))
+ {
+ throw new Exception("Xml is invalid as it failed signature check.");
+ }
+ }
+ }
+
+ static XmlDocument LoadXmlDoc(string xml)
+ {
+ try
+ {
+ var doc = new XmlDocument();
+ doc.LoadXml(xml);
+ return doc;
+ }
+ catch (XmlException exception)
+ {
+ throw new Exception("The text provided could not be parsed as XML.", exception);
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/NServiceBus.Core/App_Packages/Particular.Licensing/RegistryLicenseStore.cs b/src/NServiceBus.Core/App_Packages/Particular.Licensing/RegistryLicenseStore.cs
new file mode 100644
index 00000000000..a2fccc9274d
--- /dev/null
+++ b/src/NServiceBus.Core/App_Packages/Particular.Licensing/RegistryLicenseStore.cs
@@ -0,0 +1,90 @@
+namespace Particular.Licensing
+{
+ using System;
+ using System.Security;
+ using Microsoft.Win32;
+
+ class RegistryLicenseStore
+ {
+ public RegistryLicenseStore()
+ {
+ keyPath = DefaultKeyPath;
+ keyName = DefaultKeyName;
+ regKey = Registry.CurrentUser;
+
+ }
+
+ public RegistryLicenseStore(RegistryKey regKey, string keyPath = DefaultKeyPath, string keyName = DefaultKeyName)
+ {
+ this.keyPath = keyPath;
+ this.keyName = keyName;
+ this.regKey = regKey;
+ }
+
+ public bool TryReadLicense(out string license)
+ {
+ try
+ {
+ using (var registryKey = regKey.OpenSubKey(keyPath))
+ {
+ if (registryKey == null)
+ {
+ license = null;
+ return false;
+ }
+
+ var licenseValue = registryKey.GetValue("License", null);
+
+ if (licenseValue is string[])
+ {
+ license = string.Join(" ", (string[]) licenseValue);
+ }
+ else
+ {
+ license = (string)licenseValue;
+ }
+
+ return !string.IsNullOrEmpty(license);
+ }
+ }
+ catch (SecurityException exception)
+ {
+ throw new Exception(string.Format("Failed to access '{0}'. Do you have permission to read this key?", FullPath), exception);
+ }
+ }
+
+
+ public void StoreLicense(string license)
+ {
+ try
+ {
+ using (var registryKey = regKey.CreateSubKey(keyPath))
+ {
+ if (registryKey == null)
+ {
+ throw new Exception(string.Format("CreateSubKey for '{0}' returned null. Do you have permission to write to this key", keyPath));
+ }
+
+ registryKey.SetValue(keyName, license, RegistryValueKind.String);
+ }
+ }
+ catch (UnauthorizedAccessException exception)
+ {
+ throw new Exception(string.Format("Failed to access '{0}'. Do you have permission to write to this key?", FullPath), exception);
+ }
+ }
+
+ string FullPath
+ {
+ get { return string.Format("{0} : {1} : {2}", regKey.Name, keyPath, keyName); }
+ }
+
+ string keyPath;
+ string keyName;
+ RegistryKey regKey;
+
+
+ const string DefaultKeyPath = @"SOFTWARE\ParticularSoftware";
+ const string DefaultKeyName = "License";
+ }
+}
\ No newline at end of file
diff --git a/src/NServiceBus.Core/App_Packages/Particular.Licensing/ReleaseDateReader.cs b/src/NServiceBus.Core/App_Packages/Particular.Licensing/ReleaseDateReader.cs
new file mode 100644
index 00000000000..e29151cf0b1
--- /dev/null
+++ b/src/NServiceBus.Core/App_Packages/Particular.Licensing/ReleaseDateReader.cs
@@ -0,0 +1,23 @@
+namespace Particular.Licensing
+{
+ using System;
+ using System.Linq;
+ using System.Reflection;
+
+ static class ReleaseDateReader
+ {
+ public static DateTime GetReleaseDate()
+ {
+ var attribute = (dynamic)Assembly.GetExecutingAssembly()
+ .GetCustomAttributes(false)
+ .FirstOrDefault(x => x.GetType().Name == "ReleaseDateAttribute");
+
+ if (attribute == null)
+ {
+ throw new Exception("No ReleaseDateAttribute could be found in assembly, please make sure GitVersion is enabled");
+ }
+
+ return UniversalDateParser.Parse((string)attribute.OriginalDate);
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/NServiceBus.Core/App_Packages/Particular.Licensing/TrialStartDateStore.cs b/src/NServiceBus.Core/App_Packages/Particular.Licensing/TrialStartDateStore.cs
new file mode 100644
index 00000000000..176f492ebd5
--- /dev/null
+++ b/src/NServiceBus.Core/App_Packages/Particular.Licensing/TrialStartDateStore.cs
@@ -0,0 +1,40 @@
+namespace Particular.Licensing
+{
+ using System;
+ using System.Globalization;
+ using Microsoft.Win32;
+
+ static class TrialStartDateStore
+ {
+ public static DateTime GetTrialStartDate()
+ {
+ var rootKey = Registry.LocalMachine;
+
+ if (UserSidChecker.IsNotSystemSid())
+ {
+ rootKey = Registry.CurrentUser;
+ }
+ using (var registryKey = rootKey.CreateSubKey(StorageLocation))
+ {
+ // ReSharper disable PossibleNullReferenceException
+ //CreateSubKey does not return null http://stackoverflow.com/questions/19849870/under-what-circumstances-will-registrykey-createsubkeystring-return-null
+ var trialStartDateString = (string)registryKey.GetValue("TrialStart", null);
+ // ReSharper restore PossibleNullReferenceException
+ if (trialStartDateString == null)
+ {
+ var trialStart = DateTime.UtcNow;
+ trialStartDateString = trialStart.ToString("yyyy-MM-dd", CultureInfo.InvariantCulture);
+ registryKey.SetValue("TrialStart", trialStartDateString, RegistryValueKind.String);
+
+ return trialStart;
+ }
+
+ var trialStartDate = DateTimeOffset.ParseExact(trialStartDateString, "yyyy-MM-dd", CultureInfo.InvariantCulture, DateTimeStyles.AssumeUniversal);
+
+ return trialStartDate.Date;
+ }
+ }
+
+ public static string StorageLocation = @"SOFTWARE\ParticularSoftware";
+ }
+}
\ No newline at end of file
diff --git a/src/NServiceBus.Core/App_Packages/Particular.Licensing/UniversalDateParser.cs b/src/NServiceBus.Core/App_Packages/Particular.Licensing/UniversalDateParser.cs
new file mode 100644
index 00000000000..e6179f7eb90
--- /dev/null
+++ b/src/NServiceBus.Core/App_Packages/Particular.Licensing/UniversalDateParser.cs
@@ -0,0 +1,13 @@
+namespace Particular.Licensing
+{
+ using System;
+ using System.Globalization;
+
+ static class UniversalDateParser
+ {
+ public static DateTime Parse(string value)
+ {
+ return DateTime.ParseExact(value, "yyyy-MM-dd", null, DateTimeStyles.AssumeUniversal).ToUniversalTime();
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/NServiceBus.Core/App_Packages/Particular.Licensing/UserSidChecker.cs b/src/NServiceBus.Core/App_Packages/Particular.Licensing/UserSidChecker.cs
new file mode 100644
index 00000000000..d121ef8d446
--- /dev/null
+++ b/src/NServiceBus.Core/App_Packages/Particular.Licensing/UserSidChecker.cs
@@ -0,0 +1,15 @@
+namespace Particular.Licensing
+{
+ using System.Security.Principal;
+
+ static class UserSidChecker
+ {
+ public static bool IsNotSystemSid()
+ {
+ var windowsIdentity = WindowsIdentity.GetCurrent();
+ return windowsIdentity != null &&
+ windowsIdentity.User != null &&
+ !windowsIdentity.User.IsWellKnown(WellKnownSidType.LocalSystemSid);
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/NServiceBus.Core/DataBus/InMemory/InMemoryDataBus.cs b/src/NServiceBus.Core/DataBus/InMemory/InMemoryDataBus.cs
index a5b19cd8d0d..43f6a576e44 100644
--- a/src/NServiceBus.Core/DataBus/InMemory/InMemoryDataBus.cs
+++ b/src/NServiceBus.Core/DataBus/InMemory/InMemoryDataBus.cs
@@ -61,6 +61,7 @@ public Entry Peek(string key)
public class Entry
{
public byte[] Data;
+// ReSharper disable once NotAccessedField.Global
public DateTime ExpireAt;
}
}
diff --git a/src/NServiceBus.Core/Distributor/ConfigureDistributor.cs b/src/NServiceBus.Core/Distributor/ConfigureDistributor.cs
index 69c1d581d44..03372e26117 100644
--- a/src/NServiceBus.Core/Distributor/ConfigureDistributor.cs
+++ b/src/NServiceBus.Core/Distributor/ConfigureDistributor.cs
@@ -33,6 +33,7 @@ public static bool WorkerRunsOnThisEndpoint(this Configure config)
/// Configure the distributor to run on this endpoint
///
/// True if this endpoint should enlist as a worker
+ /// True if this endpoint should enlist as a worker
[ObsoleteEx(TreatAsErrorFromVersion = "5.0", RemoveInVersion = "6.0", Message = "The NServiceBus Distributor was moved into its own assembly (NServiceBus.Distributor.MSMQ.dll), please make sure you reference the new assembly.")]
public static Configure RunDistributor(this Configure config, bool withWorker = true)
{
diff --git a/src/NServiceBus.Core/Faults/Forwarder/MessageHelpers.cs b/src/NServiceBus.Core/Faults/Forwarder/MessageHelpers.cs
index e4c34285f53..4a1fd2022cb 100644
--- a/src/NServiceBus.Core/Faults/Forwarder/MessageHelpers.cs
+++ b/src/NServiceBus.Core/Faults/Forwarder/MessageHelpers.cs
@@ -32,8 +32,11 @@ public static string GetLabelWithoutFailedQueue(Message m)
///
public static string GetFailedQueueFromLabel(Message m)
{
+// ReSharper disable once ConditionIsAlwaysTrueOrFalse
if (m.Label == null)
+// ReSharper disable HeuristicUnreachableCode
return null;
+// ReSharper restore HeuristicUnreachableCode
if (!m.Label.Contains(FAILEDQUEUE))
return null;
diff --git a/src/NServiceBus.Core/GitFlowVersion.cs b/src/NServiceBus.Core/GitFlowVersion.cs
index a9833eb3871..477af7c728e 100644
--- a/src/NServiceBus.Core/GitFlowVersion.cs
+++ b/src/NServiceBus.Core/GitFlowVersion.cs
@@ -7,7 +7,7 @@ static class GitFlowVersion
static GitFlowVersion()
{
var assembly = typeof(GitFlowVersion).Assembly;
- var gitFlowVersionInformationType = assembly.GetType("NServiceBus.Core.GitVersionInformation", true);
+ var gitFlowVersionInformationType = assembly.GetType("GitVersionInformation", true);
var fieldInfo = gitFlowVersionInformationType.GetField("AssemblyFileVersion");
var assemblyFileVersion = Version.Parse((string)fieldInfo.GetValue(null));
MajorMinor = assemblyFileVersion.ToString(2);
diff --git a/src/NServiceBus.Core/Hosting/GenericHost.cs b/src/NServiceBus.Core/Hosting/GenericHost.cs
index 086d89a1977..26d95a133a3 100644
--- a/src/NServiceBus.Core/Hosting/GenericHost.cs
+++ b/src/NServiceBus.Core/Hosting/GenericHost.cs
@@ -23,7 +23,11 @@ public class GenericHost : IHost
/// Accepts the type which will specify the users custom configuration.
/// This type should implement .
///
+ ///
+ ///
+ ///
/// Assemblies full name that were scanned.
+ ///
public GenericHost(IConfigureThisEndpoint specifier, string[] args, List defaultProfiles,
string endpointName, IEnumerable scannableAssembliesFullName = null)
{
diff --git a/src/NServiceBus.Core/Hosting/Helpers/AssemblyScanner.cs b/src/NServiceBus.Core/Hosting/Helpers/AssemblyScanner.cs
index 006a89cb2c7..16a7738e4a1 100644
--- a/src/NServiceBus.Core/Hosting/Helpers/AssemblyScanner.cs
+++ b/src/NServiceBus.Core/Hosting/Helpers/AssemblyScanner.cs
@@ -406,7 +406,7 @@ static string DistillLowerAssemblyName(string assemblyOrFileName)
"NServiceBus.Hosting.Azure.HostProcess.exe",
// And other windows azure stuff
- "Microsoft.WindowsAzure.",
+ "Microsoft.WindowsAzure."
};
}
diff --git a/src/NServiceBus.Core/ObjectBuilder/IConfigureComponents.cs b/src/NServiceBus.Core/ObjectBuilder/IConfigureComponents.cs
index 67f1838e13a..9ea692b6325 100644
--- a/src/NServiceBus.Core/ObjectBuilder/IConfigureComponents.cs
+++ b/src/NServiceBus.Core/ObjectBuilder/IConfigureComponents.cs
@@ -12,6 +12,7 @@ public interface IConfigureComponents
///
/// Configures the given type. Can be used to configure all kinds of properties.
///
+ /// The type to configure
/// Defines lifecycle semantics for the given type.
IComponentConfig ConfigureComponent(Type concreteComponent, DependencyLifecycle dependencyLifecycle);
@@ -39,6 +40,7 @@ public interface IConfigureComponents
/// Configures the given type. Can be used to configure all kinds of properties. This method is deprecated use the signature
/// that contains the enum instead
///
+ ///
/// Defines whether the type should have singleton or single call semantics.
[ObsoleteEx(RemoveInVersion = "5.0", TreatAsErrorFromVersion = "4.0", Replacement = "ConfigureComponent(Type, DependencyLifecycle)")]
IComponentConfig ConfigureComponent(Type concreteComponent, ComponentCallModelEnum callModel);
diff --git a/src/NServiceBus.Core/Serializers/XML/XmlSanitizingStream.cs b/src/NServiceBus.Core/Serializers/XML/XmlSanitizingStream.cs
index ce3afbdc52a..805c0519119 100644
--- a/src/NServiceBus.Core/Serializers/XML/XmlSanitizingStream.cs
+++ b/src/NServiceBus.Core/Serializers/XML/XmlSanitizingStream.cs
@@ -29,8 +29,9 @@ public XmlSanitizingStream(Stream streamToSanitize)
/// The version number as a string. Use "1.0" for XML 1.0 character
/// validation, and use "1.1" for XML 1.1 character validation.
///
- /// true if is a legal xml character.
- public static bool IsLegalXmlChar(string xmlVersion, int character)
+ /// Char to check
+ /// true if is a legal xml character.
+ public static bool IsLegalXmlChar(string xmlVersion, int character)
{
switch (xmlVersion)
{
diff --git a/src/NServiceBus.Core/Transports/IDeferMessages.cs b/src/NServiceBus.Core/Transports/IDeferMessages.cs
index e7a658333d6..f63f5193f69 100644
--- a/src/NServiceBus.Core/Transports/IDeferMessages.cs
+++ b/src/NServiceBus.Core/Transports/IDeferMessages.cs
@@ -10,7 +10,9 @@ public interface IDeferMessages
///
/// Defers the given message that will be processed at the given time
///
+ /// The time when this message should be processed
/// The endpoint of the endpoint who should get the message
+ /// The message to defer
void Defer(TransportMessage message, DateTime processAt, Address address);
///
diff --git a/src/NServiceBus.Core/Unicast/MessagingBestPractices.cs b/src/NServiceBus.Core/Unicast/MessagingBestPractices.cs
index abb7b58e5c2..0c30cb5b10e 100644
--- a/src/NServiceBus.Core/Unicast/MessagingBestPractices.cs
+++ b/src/NServiceBus.Core/Unicast/MessagingBestPractices.cs
@@ -13,6 +13,7 @@ public class MessagingBestPractices
/// Enforce messaging rules. Make sure, the message can be used within the .
///
/// Event, Command or message
+ /// The intent of the message
public static void AssertIsValidForSend(Type messageType, MessageIntentEnum messageIntent)
{
if (MessageConventionExtensions.IsEventType(messageType) && messageIntent != MessageIntentEnum.Publish)
diff --git a/src/NServiceBus.Core/Unicast/UnicastBus.cs b/src/NServiceBus.Core/Unicast/UnicastBus.cs
index 0d785fa812b..d4c9afae996 100644
--- a/src/NServiceBus.Core/Unicast/UnicastBus.cs
+++ b/src/NServiceBus.Core/Unicast/UnicastBus.cs
@@ -488,7 +488,16 @@ public void Reply(Action messageConstructor)
public void Return(T errorCode)
{
- var returnMessage = ControlMessage.Create(Address.Local);
+ TransportMessage returnMessage;
+
+ if (Configure.Instance.WorkerRunsOnThisEndpoint())
+ {
+ returnMessage = ControlMessage.Create(MasterNodeAddress);
+ }
+ else
+ {
+ returnMessage = ControlMessage.Create(Address.Local);
+ }
returnMessage.MessageIntent = MessageIntentEnum.Reply;
@@ -566,7 +575,19 @@ public ICallback Send(params object[] messages)
throw new InvalidOperationException("Sends can only target one address.");
}
- var destination = destinations.SingleOrDefault();
+ if (destinations.Count == 0)
+ {
+ var messageType = "none";
+
+ if (messages != null && messages.Length >= 1)
+ {
+ messageType = messages[0].GetType().ToString();
+ }
+ var error = string.Format("No destination could be found for message type {0}. Check the section of the configuration of this endpoint for an entry either for this specific message type or for its assembly.", messageType);
+ throw new InvalidOperationException(error);
+ }
+
+ var destination = destinations[0];
return SendMessages(new SendOptions(destination), LogicalMessageFactory.CreateMultiple(messages));
}
@@ -695,12 +716,20 @@ public ICallback Defer(TimeSpan delay, object message)
public ICallback Defer(TimeSpan delay, params object[] messages)
{
- var options = new SendOptions(Address.Local)
+ SendOptions options;
+
+ if (Configure.Instance.WorkerRunsOnThisEndpoint())
{
- DelayDeliveryWith = delay,
- EnforceMessagingBestPractices = false
- };
+ options = new SendOptions(MasterNodeAddress);
+ }
+ else
+ {
+ options = new SendOptions(Address.Local);
+ }
+ options.DelayDeliveryWith = delay;
+ options.EnforceMessagingBestPractices = false;
+
return SendMessages(options, LogicalMessageFactory.CreateMultiple(messages));
}
@@ -711,15 +740,23 @@ public ICallback Defer(DateTime processAt, object message)
public ICallback Defer(DateTime processAt, params object[] messages)
{
- var options = new SendOptions(Address.Local)
+ SendOptions options;
+
+ if (Configure.Instance.WorkerRunsOnThisEndpoint())
{
- DeliverAt = processAt,
- EnforceMessagingBestPractices = false
- };
+ options = new SendOptions(MasterNodeAddress);
+ }
+ else
+ {
+ options = new SendOptions(Address.Local);
+ }
+
+ options.DeliverAt = processAt;
+ options.EnforceMessagingBestPractices = false;
+
return SendMessages(options, LogicalMessageFactory.CreateMultiple(messages));
}
-
ICallback SendMessages(SendOptions sendOptions, List messages)
{
var context = InvokeSendPipeline(sendOptions, messages);
diff --git a/src/NServiceBus.Core/Utils/Reflection/Reflect.cs b/src/NServiceBus.Core/Utils/Reflection/Reflect.cs
index eeff9ddaa22..3f9de7a44a7 100644
--- a/src/NServiceBus.Core/Utils/Reflection/Reflect.cs
+++ b/src/NServiceBus.Core/Utils/Reflection/Reflect.cs
@@ -29,6 +29,7 @@ public static PropertyInfo GetProperty(Expression> propert
///
/// Gets the property represented by the lambda expression.
///
+ /// The property expression
/// If checkForSingleDot is true, then the property expression is checked to see that only a single dot is present.
public static PropertyInfo GetProperty(Expression> property, bool checkForSingleDot)
{
@@ -38,6 +39,7 @@ public static PropertyInfo GetProperty(Expression> propert
///
/// Returns a MemberInfo for an expression containing a call to a property.
///
+ /// The expression for the member to check
/// Checks that the member expression doesn't have more than one dot like a.Prop.Val
static MemberInfo GetMemberInfo(Expression member, bool checkForSingleDot)
{
diff --git a/src/NServiceBus.Hosting.Tests/EndpointTypeTests.cs b/src/NServiceBus.Hosting.Tests/EndpointTypeTests.cs
index 269debdba2d..07373197318 100644
--- a/src/NServiceBus.Hosting.Tests/EndpointTypeTests.cs
+++ b/src/NServiceBus.Hosting.Tests/EndpointTypeTests.cs
@@ -10,6 +10,8 @@ namespace EndpointTypeTests
public abstract class TestContext
{
protected EndpointType EndpointType;
+
+// ReSharper disable once NotAccessedField.Global
protected string TestValue;
}
@@ -148,15 +150,13 @@ public void when_serviceName_is_provided_via_hostArgs_it_should_have_first_prior
[TestFixture]
public class Constructor_Tests
{
- protected EndpointType EndpointType;
-
[Test]
[ExpectedException(typeof (InvalidOperationException),
ExpectedMessage = "Endpoint configuration type needs to have a default constructor",
MatchType = MessageMatch.StartsWith)]
public void When_type_does_not_have_empty_public_constructor_it_should_blow_up()
{
- EndpointType = new EndpointType(typeof (TypeWithoutEmptyPublicConstructor));
+ new EndpointType(typeof (TypeWithoutEmptyPublicConstructor));
}
}
diff --git a/src/NServiceBus.Hosting.Tests/ProfileManagerTests.cs b/src/NServiceBus.Hosting.Tests/ProfileManagerTests.cs
index 053876ca960..d8f37465296 100644
--- a/src/NServiceBus.Hosting.Tests/ProfileManagerTests.cs
+++ b/src/NServiceBus.Hosting.Tests/ProfileManagerTests.cs
@@ -34,7 +34,7 @@ public void Should_exist_in_active_profiles()
{
var profiles = new[]
{
- typeof(InterfaceProfile).FullName,
+ typeof(InterfaceProfile).FullName
};
var profileManager = new ProfileManager(allAssemblies, null, profiles, null);
@@ -45,7 +45,7 @@ public void Should_be_activated()
{
var profiles = new[]
{
- typeof(InterfaceProfile).FullName,
+ typeof(InterfaceProfile).FullName
};
var profileManager = new ProfileManager(allAssemblies, null, profiles, null);
profileManager.ActivateProfileHandlers();
@@ -56,7 +56,7 @@ public void Should_be_returned_as_an_implementation()
{
var profiles = new[]
{
- typeof(InterfaceProfile).FullName,
+ typeof(InterfaceProfile).FullName
};
var profileManager = new ProfileManager(allAssemblies, null, profiles, null);
var implementations = profileManager.GetImplementor(typeof(IHandleProfile<>))
@@ -86,7 +86,7 @@ public void Should_exist_in_active_profiles()
{
var profiles = new[]
{
- typeof(ClassProfile).FullName,
+ typeof(ClassProfile).FullName
};
var profileManager = new ProfileManager(allAssemblies, null, profiles, null);
@@ -97,7 +97,7 @@ public void Should_be_activated()
{
var profiles = new[]
{
- typeof(ClassProfile).FullName,
+ typeof(ClassProfile).FullName
};
var profileManager = new ProfileManager(allAssemblies, null, profiles, null);
profileManager.ActivateProfileHandlers();
@@ -108,7 +108,7 @@ public void Should_be_returned_as_an_implementation()
{
var profiles = new[]
{
- typeof(ClassProfile).FullName,
+ typeof(ClassProfile).FullName
};
var profileManager = new ProfileManager(allAssemblies, null, profiles, null);
var implementations = profileManager.GetImplementor(typeof(IHandleProfile<>))
@@ -152,7 +152,7 @@ public void All_profiles_should_be_registered_in_active_profiles()
var profiles = new[]
{
typeof(ChildProfile).FullName,
- typeof(BaseProfile).FullName,
+ typeof(BaseProfile).FullName
};
var profileManager = new ProfileManager(allAssemblies, null, profiles, null);
@@ -321,7 +321,7 @@ public void Should_return_all_implementations()
{
var profiles = new[]
{
- typeof (Profile).FullName,
+ typeof (Profile).FullName
};
var profileManager = new ProfileManager(allAssemblies, null, profiles, null);
var implementations = profileManager.GetImplementor(typeof(IHandleProfile<>))
@@ -336,7 +336,7 @@ public void Both_handlers_should_be_activated()
{
var profiles = new[]
{
- typeof (Profile).FullName,
+ typeof (Profile).FullName
};
var profileManager = new ProfileManager(allAssemblies, null, profiles, null);
profileManager.ActivateProfileHandlers();
@@ -380,7 +380,7 @@ public void Should_be_correctly_ordered_in_active_profiles()
var profilesA = new[]
{
typeof (Profile1).FullName,
- typeof (Profile2).FullName,
+ typeof (Profile2).FullName
};
var profileManagerA = new ProfileManager(allAssemblies, null, profilesA, null);
Assert.AreEqual(typeof(Profile1), profileManagerA.activeProfiles[0]);
@@ -389,7 +389,7 @@ public void Should_be_correctly_ordered_in_active_profiles()
var profilesB = new[]
{
typeof (Profile2).FullName,
- typeof (Profile1).FullName,
+ typeof (Profile1).FullName
};
var profileManagerB = new ProfileManager(allAssemblies, null, profilesB, null);
Assert.AreEqual(typeof(Profile2), profileManagerB.activeProfiles[0]);
@@ -402,7 +402,7 @@ public void Should_get_implementations_in_order()
var profilesA = new[]
{
typeof (Profile1).FullName,
- typeof (Profile2).FullName,
+ typeof (Profile2).FullName
};
var profileManagerA = new ProfileManager(allAssemblies, null, profilesA, null);
var implementationsA = profileManagerA.GetImplementor(typeof(IHandleProfile<>))
@@ -413,7 +413,7 @@ public void Should_get_implementations_in_order()
var profilesB = new[]
{
typeof (Profile2).FullName,
- typeof (Profile1).FullName,
+ typeof (Profile1).FullName
};
var profileManagerB = new ProfileManager(allAssemblies, null, profilesB, null);
var implementationsB = profileManagerB.GetImplementor(typeof(IHandleProfile<>))
@@ -427,7 +427,7 @@ public void Should_activate_in_order()
var profilesA = new[]
{
typeof (Profile1).FullName,
- typeof (Profile2).FullName,
+ typeof (Profile2).FullName
};
var profileManagerA = new ProfileManager(allAssemblies, null, profilesA, null);
profileManagerA.ActivateProfileHandlers();
@@ -438,7 +438,7 @@ public void Should_activate_in_order()
var profilesB = new[]
{
typeof (Profile2).FullName,
- typeof (Profile1).FullName,
+ typeof (Profile1).FullName
};
var profileManagerB = new ProfileManager(allAssemblies, null, profilesB, null);
profileManagerB.ActivateProfileHandlers();
@@ -474,7 +474,7 @@ public void Should_activate_once_only()
var profilesA = new[]
{
typeof (Profile1).FullName,
- typeof (Profile2).FullName,
+ typeof (Profile2).FullName
};
var profileManagerA = new ProfileManager(allAssemblies, null, profilesA, null);
profileManagerA.ActivateProfileHandlers();
@@ -568,7 +568,7 @@ public void Should_return_concrete_implementation()
{
var profiles = new[]
{
- typeof (Profile).FullName,
+ typeof (Profile).FullName
};
var profileManager = new ProfileManager(allAssemblies, null, profiles, null);
var implementations = profileManager.GetImplementor(typeof(IHandleProfile<>))
@@ -581,7 +581,7 @@ public void Only_child_should_be_activated()
{
var profiles = new[]
{
- typeof (Profile).FullName,
+ typeof (Profile).FullName
};
var profileManager = new ProfileManager(allAssemblies, null, profiles, null);
profileManager.ActivateProfileHandlers();
@@ -620,7 +620,7 @@ public void ActiveProfiles_should_be_set()
{
var profiles = new[]
{
- typeof (Profile).FullName,
+ typeof (Profile).FullName
};
var configureThisEndpoint = new ConfigureThisEndpoint();
var profileManager = new ProfileManager(allAssemblies, configureThisEndpoint, profiles, null);
@@ -656,7 +656,7 @@ public void ActiveProfiles_should_be_set()
{
var profiles = new[]
{
- typeof (Profile).FullName,
+ typeof (Profile).FullName
};
var profileManager = new ProfileManager(allAssemblies, null, profiles, null);
profileManager.ActivateProfileHandlers();
@@ -689,7 +689,7 @@ public void ProfileActivated_should_be_called()
{
var profiles = new[]
{
- typeof (Profile).FullName,
+ typeof (Profile).FullName
};
var profileManager = new ProfileManager(allAssemblies, null, profiles, null);
profileManager.ActivateProfileHandlers();
@@ -724,7 +724,7 @@ public void Should_return_all_implementations()
{
var profiles = new[]
{
- typeof (Profile).FullName,
+ typeof (Profile).FullName
};
var profileManager = new ProfileManager(allAssemblies, null, profiles, null);
var implementations = profileManager.GetImplementor(typeof(IHandleProfile<>))
diff --git a/src/NServiceBus.Hosting.Windows/WindowsHost.cs b/src/NServiceBus.Hosting.Windows/WindowsHost.cs
index 4b33060a524..6cd506811aa 100644
--- a/src/NServiceBus.Hosting.Windows/WindowsHost.cs
+++ b/src/NServiceBus.Hosting.Windows/WindowsHost.cs
@@ -18,7 +18,11 @@ public class WindowsHost : MarshalByRefObject
/// Accepts the type which will specify the users custom configuration.
/// This type should implement .
///
+ ///
/// Name of scan-able assemblies
+ /// Type of the endpoint
+ /// Command line ares
+ /// The name of the endpoint
public WindowsHost(Type endpointType, string[] args, string endpointName, bool runOtherInstallers, IEnumerable scannableAssembliesFullName)
{
var specifier = (IConfigureThisEndpoint)Activator.CreateInstance(endpointType);
diff --git a/src/NServiceBus.PerformanceTests/Encryption/EncryptionTestMessage.cs b/src/NServiceBus.PerformanceTests/Encryption/EncryptionTestMessage.cs
index 4e33b02ac8a..57b1c604d3c 100644
--- a/src/NServiceBus.PerformanceTests/Encryption/EncryptionTestMessage.cs
+++ b/src/NServiceBus.PerformanceTests/Encryption/EncryptionTestMessage.cs
@@ -9,6 +9,7 @@ namespace Runner.Encryption
public class EncryptionTestMessage : MessageBase
{
public WireEncryptedString Secret { get; set; }
+// ReSharper disable once NotAccessedField.Global
public WireEncryptedString SecretField;
public ClassForNesting CreditCard { get; set; }
public WireEncryptedString SecretThatIsNull { get; set; }
diff --git a/src/NServiceBus.sln.DotSettings b/src/NServiceBus.sln.DotSettings
index 1a34c021dbc..411e1127cdf 100644
--- a/src/NServiceBus.sln.DotSettings
+++ b/src/NServiceBus.sln.DotSettings
@@ -14,9 +14,24 @@
DO_NOT_SHOW
ERROR
ERROR
- WARNING
+ ERROR
ERROR
+ ERROR
+ DO_NOT_SHOW
+ DO_NOT_SHOW
+ DO_NOT_SHOW
+ ERROR
ERROR
+ ERROR
+ ERROR
+ ERROR
+ ERROR
+ ERROR
+ ERROR
+ ERROR
+ ERROR
+ ERROR
+ ERROR
ERROR
ERROR
ERROR
@@ -24,13 +39,15 @@
ERROR
ERROR
ERROR
+ ERROR
ERROR
DO_NOT_SHOW
DO_NOT_SHOW
+ ERROR
DO_NOT_SHOW
DO_NOT_SHOW
ERROR
- WARNING
+ ERROR
ERROR
ERROR
ERROR
@@ -44,8 +61,9 @@
ERROR
ERROR
ERROR
- SUGGESTION
- DO_NOT_SHOW
+ ERROR
+ ERROR
+ ERROR
ERROR
ERROR
ERROR
@@ -61,6 +79,7 @@
ERROR
ERROR
ERROR
+ ERROR
ERROR
ERROR
WARNING
@@ -86,6 +105,7 @@
DoHide
DoHide
DoHide
+ ERROR
ERROR
ERROR
ERROR
@@ -93,10 +113,13 @@
ERROR
ERROR
ERROR
+ ERROR
ERROR
ERROR
DO_NOT_SHOW
SUGGESTION
+ WARNING
+ WARNING
ERROR
ERROR
ERROR
@@ -105,6 +128,7 @@
<?xml version="1.0" encoding="utf-16"?><Profile name="Format My Code Using "Particular" conventions"><CSMakeFieldReadonly>True</CSMakeFieldReadonly><CSUseVar><BehavourStyle>CAN_CHANGE_TO_IMPLICIT</BehavourStyle><LocalVariableStyle>ALWAYS_IMPLICIT</LocalVariableStyle><ForeachVariableStyle>ALWAYS_IMPLICIT</ForeachVariableStyle></CSUseVar><CSOptimizeUsings><OptimizeUsings>True</OptimizeUsings><EmbraceInRegion>False</EmbraceInRegion><RegionName></RegionName></CSOptimizeUsings><CSReformatCode>True</CSReformatCode><CSReorderTypeMembers>True</CSReorderTypeMembers><JsInsertSemicolon>True</JsInsertSemicolon><JsReformatCode>True</JsReformatCode><CssReformatCode>True</CssReformatCode><CSArrangeThisQualifier>True</CSArrangeThisQualifier><RemoveCodeRedundancies>True</RemoveCodeRedundancies><CSUseAutoProperty>True</CSUseAutoProperty><HtmlReformatCode>True</HtmlReformatCode><CSShortenReferences>True</CSShortenReferences><CSharpFormatDocComments>True</CSharpFormatDocComments><CssAlphabetizeProperties>True</CssAlphabetizeProperties></Profile>
Default: Reformat Code
Format My Code Using "Particular" conventions
+ False
False
ALWAYS_ADD
ALWAYS_ADD
@@ -326,6 +350,7 @@ II.2.12 <HandlesEvent />
CustomLayout
True
+ True
True
False
True
diff --git a/src/NServiceBus/NServiceBusVersion.cs b/src/NServiceBus/NServiceBusVersion.cs
index 99dc6eef203..a26134182a1 100644
--- a/src/NServiceBus/NServiceBusVersion.cs
+++ b/src/NServiceBus/NServiceBusVersion.cs
@@ -10,7 +10,7 @@ public static class NServiceBusVersion
static NServiceBusVersion()
{
var assembly = typeof(NServiceBusVersion).Assembly;
- var gitFlowVersionInformationType = assembly.GetType("NServiceBus.GitVersionInformation", true);
+ var gitFlowVersionInformationType = assembly.GetType("GitVersionInformation", true);
var fieldInfo = gitFlowVersionInformationType.GetField("AssemblyFileVersion");
var assemblyFileVersion = System.Version.Parse((string)fieldInfo.GetValue(null));
Version = assemblyFileVersion.ToString(3);
diff --git a/src/ObjectBuilder.StructureMap/StructureMapObjectBuilder.cs b/src/ObjectBuilder.StructureMap/StructureMapObjectBuilder.cs
index 655a422c2ef..ad382166b82 100644
--- a/src/ObjectBuilder.StructureMap/StructureMapObjectBuilder.cs
+++ b/src/ObjectBuilder.StructureMap/StructureMapObjectBuilder.cs
@@ -193,6 +193,7 @@ static ILifecycle GetLifecycleFrom(DependencyLifecycle dependencyLifecycle)
static IEnumerable GetAllInterfacesImplementedBy(Type t)
{
+// ReSharper disable once ConditionIsAlwaysTrueOrFalse
return t.GetInterfaces().Where(x=>x.FullName != null && !x.FullName.StartsWith("System."));
}
diff --git a/src/ObjectBuilder.Unity/UnityObjectBuilder.cs b/src/ObjectBuilder.Unity/UnityObjectBuilder.cs
index 8724fbcf3b0..2cebc5f7215 100644
--- a/src/ObjectBuilder.Unity/UnityObjectBuilder.cs
+++ b/src/ObjectBuilder.Unity/UnityObjectBuilder.cs
@@ -147,6 +147,7 @@ static IEnumerable GetAllServiceTypesFor(Type t)
return new List();
}
+// ReSharper disable once ConditionIsAlwaysTrueOrFalse
return new List(t.GetInterfaces().Where(x => x.FullName != null && !x.FullName.StartsWith("System.")))
{
t