Removed MSBuild trap

Removed MSBuild trap

on Linux, MSBuild get's very broken when you have a directory that has a backslash in a name

--- src/DotVVM.Samples.Common/ViewModels/ControlSamples/FileUpload/FileUploadViewModel.cs
+++ src/DotVVM.Samples.Common/ViewModels/ControlSamples/FileUpload/FileUploadViewModel.cs
@@ -62,7 +62,7 @@

         private string GetUploadPath()
         {
-            var uploadPath = Path.Combine(Context.Configuration.ApplicationPhysicalPath, "Temp\\Upload");
+            var uploadPath = Path.Combine(Context.Configuration.ApplicationPhysicalPath, "Temp/Upload");
             if (!Directory.Exists(uploadPath))
             {
                 Directory.CreateDirectory(uploadPath);
@@ -70,4 +70,4 @@
             return uploadPath;
         }
     }
-}+}


Reduce Vector register pressure by not overlapping

--- src/Microsoft.AspNetCore.Server.Kestrel/Internal/Infrastructure/MemoryPoolIterator.cs
+++ src/Microsoft.AspNetCore.Server.Kestrel/Internal/Infrastructure/MemoryPoolIterator.cs
@@ -509,13 +509,14 @@
                         if (following >= _vectorSpan)
                         {
                             var data = new Vector<byte>(array, index);
+
                             var byte0Equals = Vector.Equals(data, byte0Vector);
+                            if (!byte0Equals.Equals(Vector<byte>.Zero))
+                            {
+                                byte0Index = LocateFirstFoundByte(ref byte0Equals);
+                            }
+
                             var byte1Equals = Vector.Equals(data, byte1Vector);
-
-                            if (!byte0Equals.Equals(Vector<byte>.Zero))
-                            {
-                                byte0Index = LocateFirstFoundByte(ref byte0Equals);
-                            }
                             if (!byte1Equals.Equals(Vector<byte>.Zero))
                             {
                                 byte1Index = LocateFirstFoundByte(ref byte1Equals);
@@ -652,18 +653,20 @@
                         if (following >= _vectorSpan)
                         {
                             var data = new Vector<byte>(array, index);
+
                             var byte0Equals = Vector.Equals(data, byte0Vector);
+                            if (!byte0Equals.Equals(Vector<byte>.Zero))
+                            {
+                                byte0Index = LocateFirstFoundByte(ref byte0Equals);
+                            }
+
                             var byte1Equals = Vector.Equals(data, byte1Vector);
+                            if (!byte1Equals.Equals(Vector<byte>.Zero))
+                            {
+                                byte1Index = LocateFirstFoundByte(ref byte1Equals);
+                            }
+
                             var byte2Equals = Vector.Equals(data, byte2Vector);
-
-                            if (!byte0Equals.Equals(Vector<byte>.Zero))
-                            {
-                                byte0Index = LocateFirstFoundByte(ref byte0Equals);
-                            }
-                            if (!byte1Equals.Equals(Vector<byte>.Zero))
-                            {
-                                byte1Index = LocateFirstFoundByte(ref byte1Equals);
-                            }
                             if (!byte2Equals.Equals(Vector<byte>.Zero))
                             {
                                 byte2Index = LocateFirstFoundByte(ref byte2Equals);


Apply utility methods to EnableLighting analyzer

--- src/OpenTKAnalyzer/OpenTKAnalyzer/OpenTK_/Graphics_/OpenGL_/EnableLightingAnalyzer.cs
+++ src/OpenTKAnalyzer/OpenTKAnalyzer/OpenTK_/Graphics_/OpenGL_/EnableLightingAnalyzer.cs
@@ -6,7 +6,7 @@
 using Microsoft.CodeAnalysis.CSharp.Syntax;
 using Microsoft.CodeAnalysis.Diagnostics;
 using OpenTK.Graphics.OpenGL;
-
+using OpenTKAnalyzer.Utility;

 namespace OpenTKAnalyzer.OpenTK_.Graphics_.OpenGL_
 {
@@ -42,7 +42,7 @@
 			var root = await context.SemanticModel.SyntaxTree.GetRootAsync();
 			var invocations = root.DescendantNodes().OfType<InvocationExpressionSyntax>();

-			var lights = invocations.Where(i => i.Expression.WithoutTrivia().ToFullString() == nameof(GL) + "." + nameof(GL.Light));
+			var lights = invocations.Where(i => i.GetMethodName() == nameof(GL) + "." + nameof(GL.Light));
 			var useLights = new bool[8];
 			var lightLocations = new List<Location>[8];
 			for (int i = 0; i < lightLocations.Length; i++)
@@ -51,7 +51,7 @@
 			}
 			foreach (var lightOp in lights)
 			{
-				var expression = lightOp.ArgumentList.Arguments.FirstOrDefault()?.ChildNodes()?.First();
+				var expression = lightOp.GetNthArgumentExpression(0);
 				if (expression == null)
 				{
 					continue;
@@ -62,7 +62,7 @@
 					continue;
 				}
 				int number;
-				if (symbol.Name.Length > 5 && int.TryParse(symbol.Name.Substring(5), out number))
+				if (symbol.Name.Length > 5 && int.TryParse(symbol.Name.Substring(5), out number) && 0 <= number && number < 8)
 				{
 					useLights[number] = true;
 					lightLocations[number].Add(lightOp.GetLocation());
@@ -74,13 +74,13 @@
 			}

 			// need light enabling
-			var enables = invocations.Where(i => i.Expression.WithoutTrivia().ToFullString() == nameof(GL) + "." + nameof(GL.Enable));
+			var enables = invocations.Where(i => i.GetMethodName() == nameof(GL) + "." + nameof(GL.Enable));
 			var enableLights = new bool[8];
 			var enableWholeLighting = false;
 			var enableLocations = new List<Location>();
 			foreach (var enableOp in enables)
 			{
-				var expression = enableOp.ArgumentList.Arguments.FirstOrDefault()?.ChildNodes()?.First();
+				var expression = enableOp.GetNthArgumentExpression(0);
 				if (expression == null)
 				{
 					continue;
@@ -96,7 +96,7 @@
 					continue;
 				}
 				int number;
-				if (symbol.Name.Length > 5 && int.TryParse(symbol.Name.Substring(5), out number))
+				if (symbol.Name.Length > 5 && int.TryParse(symbol.Name.Substring(5), out number) && 0 <= number && number < 8)
 				{
 					enableLights[number] = true;
 					enableLocations.Add(enableOp.GetLocation());
@@ -111,7 +111,7 @@
 						context.ReportDiagnostic(Diagnostic.Create(
 							descriptor: Rule,
 							location: location,
-							messageArgs: nameof(GL) + "." + nameof(GL.Enable) + "(" + nameof(EnableCap) + ".Light" + i + ")"));
+							messageArgs: $"{nameof(GL)}.{nameof(GL.Enable)}({nameof(EnableCap)}.Light{i})"));
 					}
 				}
 			}
@@ -122,7 +122,7 @@
 					context.ReportDiagnostic(Diagnostic.Create(
 						descriptor: Rule,
 						location: location,
-						messageArgs: nameof(GL) + "." + nameof(GL.Enable) + "(" + nameof(EnableCap) + "." + nameof(EnableCap.Lighting) + ")"));
+						messageArgs: $"{nameof(GL)}.{nameof(GL.Enable)}({nameof(EnableCap)}.{nameof(EnableCap.Lighting)})"));
 				}
 			}
 		}


Added error class and validation msg for training code

--- src/SFA.DAS.ProviderApprenticeshipsService.Web/Views/Shared/EditApprenticeship.cshtml
+++ src/SFA.DAS.ProviderApprenticeshipsService.Web/Views/Shared/EditApprenticeship.cshtml
@@ -51,16 +51,16 @@
     @Html.TextBoxFor(m => m.ULN, new { @class = "form-control form-control-3-4", type = "number", aria_labelledby = Html.IdFor(m => m.ULN) })

-

+
 x.TrainingCode, "error")">

     Apprenticeship training course
     Start typing in the name of the course or choose an option from the list
+    @Html.ValidationMessageFor(m => m.TrainingCode, null, new { id = "error-message-" + Html.IdFor(m => m.TrainingCode), @class = "error-message" })
     <select name="TrainingCode" id="TrainingCode" class="form-control form-control-3-4" aria-label="Apprenticeship training course">
         <option value="">Please select</option>
         @foreach (var programme in ViewBag.ApprenticeshipProgrammes)
             {
-            <option value="@programme.Id" @if (programme.Id.ToString() == Model.TrainingCode) { @Html.Raw("selected")    }>
-
+            <option value="@programme.Id" @if (programme.Id.ToString() == Model.TrainingCode) { @Html.Raw("selected")} >
                 @programme.Title
             </option>
         }


Removed unused UpdateWhenChainDownloaded method (#336)

--- src/Stratis.FederatedPeg.Features.FederationGateway/Wallet/FederationWalletManager.cs
+++ src/Stratis.FederatedPeg.Features.FederationGateway/Wallet/FederationWalletManager.cs
@@ -957,41 +957,6 @@
             return wallet;
         }

-        /// <summary>
-        /// Updates details of the last block synced in a wallet when the chain of headers finishes downloading.
-        /// </summary>
-        /// <param name="wallets">The wallets to update when the chain has downloaded.</param>
-        /// <param name="date">The creation date of the block with which to update the wallet.</param>
-        private void UpdateWhenChainDownloaded(IEnumerable<FederationWallet> wallets, DateTime date)
-        {
-            this.asyncLoopFactory.RunUntil("WalletManager.DownloadChain", this.nodeLifetime.ApplicationStopping,
-                () => this.chain.IsDownloaded(),
-                () =>
-                {
-                    int heightAtDate = this.chain.GetHeightAtTime(date);
-
-                    // TODO why are we foreaching wallets and doing nothing with each wallet?
-                    foreach (FederationWallet wallet in wallets)
-                    {
-                        this.logger.LogTrace("The chain of headers has finished downloading, updating wallet with height {0}", heightAtDate);
-                        this.UpdateLastBlockSyncedHeight(this.chain.GetBlock(heightAtDate));
-                        this.SaveWallet();
-                    }
-                },
-                (ex) =>
-                {
-                    // in case of an exception while waiting for the chain to be at a certain height, we just cut our losses and
-                    // sync from the current height.
-                    this.logger.LogError($"Exception occurred while waiting for chain to download: {ex.Message}");
-
-                    foreach (FederationWallet wallet in wallets)
-                    {
-                        this.UpdateLastBlockSyncedHeight(this.chain.Tip);
-                    }
-                },
-                TimeSpans.FiveSeconds);
-        }
-
         /// <inheritdoc />
         public void ImportMemberKey(string password, string mnemonic, string passphrase)
         {


Change Error class to internal

Change Error class to internal

--- src/TelemetryChannels/ServerTelemetryChannel/Shared/Implementation/BackendResponse.cs
+++ src/TelemetryChannels/ServerTelemetryChannel/Shared/Implementation/BackendResponse.cs
@@ -15,7 +15,7 @@
         public Error[] Errors { get; set; }

         [DataContract]
-        public class Error
+        internal class Error
         {
             [DataMember(Name = "index")]
             public int Index { get; set; }


Cyrillic alphabet support added

Cyrillic alphabet support added

--- classes.CS/CJson.cs
+++ classes.CS/CJson.cs
@@ -76,7 +76,7 @@
 					oRequest.Method = "POST";
 					oRequest.Accept = "application/json-rpc";
 					oRequest.ContentType = "application/json-rpc; charset=UTF-8";
-					strBodyRequest = strData.Replace("\r", "").Replace("\n", "").Replace("\r\n", "").Replace("\t", "");
+					strBodyRequest = strData;
 					break;

 				case EHTTPMethod.GET:


Make GetFileDistributedWithApplication also search "src", as GetDirectoryDistributedWithApplication already does. Tightened up the code a bit in both methods.

--- Palaso/IO/FileLocator.cs
+++ Palaso/IO/FileLocator.cs
@@ -248,20 +248,18 @@
 		}

-		/// <summary>
-		/// Find a file which, on a development machine, lives in [solution]/[distFileFolderName]/[subPath],
-		/// and when installed, lives in
-		/// [applicationFolder]/[distFileFolderName]/[subPath1]/[subPathN]  or
-		/// [applicationFolder]/[subPath]/[subPathN]
-		/// </summary>
-		/// <example>GetFileDistributedWithApplication("info", "releaseNotes.htm");</example>
-		public static string GetFileDistributedWithApplication(bool optional, params string[] partsOfTheSubPath)
-		{
-			foreach (var directoryHoldingFiles in new []{null, "DistFiles", "common" /*for wesay*/})
-			{
-				var path = FileLocator.DirectoryOfApplicationOrSolution;
-				if(directoryHoldingFiles!=null)
-					path = Path.Combine(path, directoryHoldingFiles);
+	    /// <summary>
+	    /// Find a file which, on a development machine, lives in [solution]/[distFileFolderName]/[subPath],
+	    /// and when installed, lives in
+	    /// [applicationFolder]/[distFileFolderName]/[subPath1]/[subPathN]  or
+	    /// [applicationFolder]/[subPath]/[subPathN]
+	    /// </summary>
+	    /// <example>GetFileDistributedWithApplication("info", "releaseNotes.htm");</example>
+	    public static string GetFileDistributedWithApplication(bool optional, params string[] partsOfTheSubPath)
+	    {
+	        foreach (var directoryHoldingFiles in new[] {"", "DistFiles", "common" /*for wesay*/, "src" /*for Bloom*/})
+			{
+                var path = Path.Combine(FileLocator.DirectoryOfApplicationOrSolution, directoryHoldingFiles);

 				foreach (var part in partsOfTheSubPath)
 				{
@@ -310,23 +308,16 @@
 			if (Directory.Exists(path))
 				return path;

-			//try distfiles
-			path = FileLocator.DirectoryOfApplicationOrSolution;
-			path = Path.Combine(path,"DistFiles");
-			foreach (var part in partsOfTheSubPath)
-			{
-				path = System.IO.Path.Combine(path, part);
-			}
-			if (Directory.Exists(path))
-				return path;
-
-			//try src (e.g. Bloom keeps its javascript under source directory (and in distfiles only when installed)
-			path = FileLocator.DirectoryOfApplicationOrSolution;
-			path = Path.Combine(path, "src");
-			foreach (var part in partsOfTheSubPath)
-			{
-				path = System.IO.Path.Combine(path, part);
-			}
+		    foreach (var directoryHoldingFiles in new[] {"", "DistFiles", "common" /*for wesay*/, "src" /*for Bloom*/})
+		    {
+		        path = Path.Combine(FileLocator.DirectoryOfApplicationOrSolution, directoryHoldingFiles);
+		        foreach (var part in partsOfTheSubPath)
+		        {
+		            path = System.IO.Path.Combine(path, part);
+		        }
+		        if (Directory.Exists(path))
+		            return path;
+		    }

 			if (optional && !Directory.Exists(path))
 				return null;


Fixed IPathfinderMod types not loading

Fixed IPathfinderMod types not loading

--- Pathfinder/Pathfinder.cs
+++ Pathfinder/Pathfinder.cs
@@ -61,8 +61,12 @@
                 {
                     var modAssembly = Assembly.LoadFile(dll);
                     Type modType = null;
-                    foreach (Type t in (modAssembly.GetTypes().Where(myType => myType.IsClass && !myType.IsAbstract && myType.IsSubclassOf(typeof(PathfinderMod)))))
+                    foreach (Type t in (modAssembly.GetExportedTypes().Where(t =>
+                                                                     t.IsClass && !t.IsAbstract
+                                                                     && typeof(IPathfinderMod).IsAssignableFrom(t)))
+                            )
                     {
+                        string name = null;
                         try
                         {
                             modType = t;
@@ -72,20 +76,22 @@
                             if (methodInfo == null)
                                 throw new NotSupportedException("Method 'Identifier' doesn't exist, mod '"
                                                                 + Path.GetFileName(modAssembly.Location) + "' is invalid");
-                            var name = (string)methodInfo.Invoke(modInstance, null);
+                            name = (string)methodInfo.Invoke(modInstance, null);
                             if (IsModLoaded(name))
                                 throw new ExceptionInvalidId("Mod with identifier '" + name + "' is either already loaded or is reserved");
                             if (name.Contains('.'))
                                 throw new ExceptionInvalidId("Mod identifier '" + name + "' contains a period, mod identifiers may not contain a period (.)");
                             Logger.Info("Loading mod '{0}'", name);

+                            mods.Add(name, modInstance);
+
                             modInstance.Load();
-
-                            mods.Add(name, modInstance);
                         }
                         catch (Exception ex)
                         {
                             Logger.Error("Mod '{0}' of file '{1}' failed to load:\n\t{2}", t.FullName, Path.GetFileName(dll), ex);
+                            if (mods.ContainsKey(name))
+                                mods.Remove(name);
                         }
                     }
                 }


Fix LSX tree parsing bug

Fix LSX tree parsing bug

--- LSLib/LS/LSXReader.cs
+++ LSLib/LS/LSXReader.cs
@@ -31,7 +31,7 @@
             {
                 Resource rsrc = new Resource();
                 Region currentRegion = null;
-                Stack<Node> stack = new Stack<Node>();
+                List<Node> stack = new List<Node>();

                 while (reader.Read())
                 {
@@ -97,7 +97,7 @@
                                     node.Parent.AppendChild(node);

                                 if (!reader.IsEmptyElement)
-                                    stack.Push(node);
+                                    stack.Add(node);
                                 break;

                             case "attribute":
@@ -117,7 +117,7 @@
                                     Debug.Assert(((TranslatedString)attr.Value).Handle != null);
                                 }

-                                stack.Peek().Attributes.Add(attrName, attr);
+                                stack.Last().Attributes.Add(attrName, attr);
                                 break;

                             case "children":
@@ -148,7 +148,7 @@
                                 break;

                             case "node":
-                                stack.Pop();
+                                stack.RemoveAt(stack.Count - 1);
                                 break;

                             default:


Renamed diff command to status

Renamed diff command to status

--- Addons/Entitas.CodeGeneration.CodeGenerator.CLI/Program.cs
+++ Addons/Entitas.CodeGeneration.CodeGenerator.CLI/Program.cs
@@ -37,11 +37,11 @@
                     case "doctor":
                         doctor();
                         break;
+                    case "status":
+                        status();
+                        break;
                     case "fix":
                         fixConfig();
-                        break;
-                    case "diff":
-                        diff();
                         break;
                     case "scan":
                         scanDlls();
@@ -63,7 +63,11 @@
                         _logger.Error(e.ToString());
                     }
                 } else {
-                    _logger.Error(ex.Message);
+                    if(args.Any(arg => arg == "-v")) {
+                        _logger.Error(ex.ToString());
+                    } else {
+                        _logger.Error(ex.Message);
+                    }
                 }
             }
         }
@@ -74,7 +78,7 @@
 @"usage: entitas new [-f] - Creates new Entitas.properties config with default values
        entitas edit     - Opens Entitas.properties config
        entitas doctor   - Checks the config for potential problems
-       entitas diff     - Lists available and unavailable plugins
+       entitas status   - Lists available and unavailable plugins
        entitas fix      - Adds missing or removes unused keys interactively
        entitas scan     - Scans and prints available types found in specified assemblies
        entitas dry      - Simulates generating files without writing to disk
@@ -138,7 +142,7 @@

         static void doctor() {
             if(File.Exists(Preferences.configPath)) {
-                diff();
+                status();
                 _logger.Debug("Dry Run");
                 CodeGeneratorUtil
                     .CodeGeneratorFromConfig(Preferences.configPath)
@@ -184,7 +188,7 @@
             return keyChar == 'y';
         }

-        static void diff() {
+        static void status() {
             if(File.Exists(Preferences.configPath)) {
                 var fileContent = File.ReadAllText(Preferences.configPath);
                 var properties = new Properties(fileContent);


Test coverage ensuring attributed constructor parameters aren't affected by configured ignore filters

--- AgileMapper.UnitTests/Configuration/WhenIgnoringMembers.cs
+++ AgileMapper.UnitTests/Configuration/WhenIgnoringMembers.cs
@@ -335,11 +335,28 @@
                 mapper.WhenMapping
                     .IgnoreTargetMembersWhere(member => member.HasAttribute<IgnoreMeAttribute>());

-                var source = new { Value = "hgfd" };
+                var source = new { Value1 = "hgfd", Value2 = default(string) };

                 var result = mapper.Map(source).ToANew<AttributeHelper>();

-                result.Value.ShouldBeNull();
+                result.Value1.ShouldBeNull();
+            }
+        }
+
+        [Fact]
+        public void ShouldNotAttemptToIgnoreAttributedConstructorParameters()
+        {
+            using (var mapper = Mapper.CreateNew())
+            {
+                mapper.WhenMapping
+                    .IgnoreTargetMembersWhere(member => member.HasAttribute<IgnoreMeAttribute>());
+
+                var source = new { Value2 = "hjkhgff" };
+
+                var result = mapper.Map(source).ToANew<AttributeHelper>();
+
+                result.Value1.ShouldBeNull();
+                result.Value2.ShouldBe("hjkhgff");
             }
         }

@@ -365,8 +382,15 @@

         public class AttributeHelper
         {
+            public AttributeHelper([IgnoreMe]string value2)
+            {
+                Value2 = value2;
+            }
+
             [IgnoreMe]
-            public string Value { get; set; }
+            public string Value1 { get; set; }
+
+            public string Value2 { get; }
         }

         public sealed class IgnoreMeAttribute : Attribute