* Added API method to convert certificates from DER to PEM formats

--- source/TestAuthorityCore/Controllers/CertificateTools.cs
+++ source/TestAuthorityCore/Controllers/CertificateTools.cs
@@ -19,7 +19,19 @@
     [Route("api/tools")]
     public class CertificateTools : Controller
     {
-        [HttpPost("to-pfx")]
+        [HttpPost("der-to-pem")]
+        public IActionResult ConvertCertificateToPem([FromForm] IFormFile file, string certificateName = "certificate.crt")
+        {
+            using (var streamReader = new StreamReader(file.OpenReadStream()))
+            {
+                X509Certificate certificate = new X509CertificateParser().ReadCertificate(streamReader.BaseStream);
+                string certificateString = ConvertCertificateToPem(certificate);
+                byte[] result = Encoding.ASCII.GetBytes(certificateString);
+                return File(result, MediaTypeNames.Application.Octet, certificateName);
+            }
+        }
+
+        [HttpPost("pem-to-pfx")]
         public IActionResult ConvertToPfx([FromForm] IFormFile pemCertificate, [FromForm] IFormFile pemKey, string password, string filename = "certificate.pfx")
         {
             byte[] certificate;
@@ -43,44 +55,6 @@
             return File(result, MediaTypeNames.Application.Octet, filename);
         }

-        private byte[] ConvertToPfxImpl(byte[] certificate, byte[] privateKey, string password)
-        {
-            AsymmetricCipherKeyPair asymmetricCipherKeyPair = null;
-            var certificateEntry = new X509CertificateEntry[1];
-
-            Pkcs12Store store = new Pkcs12StoreBuilder().Build();
-
-            using (var stream = new MemoryStream(privateKey))
-            {
-                using (var streamReader = new StreamReader(stream))
-                {
-                    object value = new PemReader(streamReader).ReadObject();
-                    if (value is AsymmetricCipherKeyPair pair)
-                    {
-                        asymmetricCipherKeyPair = pair;
-                    }
-                }
-            }
-
-            using (var stream = new MemoryStream(certificate))
-            {
-                using (var streamReader = new StreamReader(stream))
-                {
-                    object value = new PemReader(streamReader).ReadObject();
-                    if (value is X509Certificate x509Certificate)
-                    {
-                        certificateEntry[0] = new X509CertificateEntry(x509Certificate);
-                    }
-                }
-            }
-
-            store.SetKeyEntry("certificate", new AsymmetricKeyEntry(asymmetricCipherKeyPair.Private), certificateEntry);
-            var result = new MemoryStream();
-            store.Save(result, password.ToCharArray(), new SecureRandom());
-            result.Position = 0;
-            return result.ToArray();
-        }
-
         [HttpPost("pfx-to-certificate")]
         public IActionResult GetCertificateFromPfx([FromForm] IFormFile file, string password, string certificateName = "certificate.crt")
         {
@@ -95,7 +69,7 @@

                 X509CertificateEntry certificateEntry = store.GetCertificate(firstAlias);

-                string certificateString = ConvertCertificateToPem(certificateEntry);
+                string certificateString = ConvertCertificateToPem(certificateEntry.Certificate);
                 byte[] result = Encoding.ASCII.GetBytes(certificateString);
                 return File(result, MediaTypeNames.Application.Octet, certificateName);
             }
@@ -122,9 +96,9 @@
             }
         }

-        private static string ConvertCertificateToPem(X509CertificateEntry certificateEntry)
+        private static string ConvertCertificateToPem(X509Certificate certificate)
         {
-            var generator = new MiscPemGenerator(certificateEntry.Certificate);
+            var generator = new MiscPemGenerator(certificate);

             string certificateString;
             using (var textWriter = new StringWriter())
@@ -174,5 +148,43 @@

             return certificateString;
         }
+
+        private byte[] ConvertToPfxImpl(byte[] certificate, byte[] privateKey, string password)
+        {
+            AsymmetricCipherKeyPair asymmetricCipherKeyPair = null;
+            var certificateEntry = new X509CertificateEntry[1];
+
+            Pkcs12Store store = new Pkcs12StoreBuilder().Build();
+
+            using (var stream = new MemoryStream(privateKey))
+            {
+                using (var streamReader = new StreamReader(stream))
+                {
+                    object value = new PemReader(streamReader).ReadObject();
+                    if (value is AsymmetricCipherKeyPair pair)
+                    {
+                        asymmetricCipherKeyPair = pair;
+                    }
+                }
+            }
+
+            using (var stream = new MemoryStream(certificate))
+            {
+                using (var streamReader = new StreamReader(stream))
+                {
+                    object value = new PemReader(streamReader).ReadObject();
+                    if (value is X509Certificate x509Certificate)
+                    {
+                        certificateEntry[0] = new X509CertificateEntry(x509Certificate);
+                    }
+                }
+            }
+
+            store.SetKeyEntry("certificate", new AsymmetricKeyEntry(asymmetricCipherKeyPair.Private), certificateEntry);
+            var result = new MemoryStream();
+            store.Save(result, password.ToCharArray(), new SecureRandom());
+            result.Position = 0;
+            return result.ToArray();
+        }
     }
 }


#100 Fixed unreachable containers.

#100 Fixed unreachable containers.

--- ExampleScripts/UOErebor/EquipSet.csx
+++ ExampleScripts/UOErebor/EquipSet.csx
@@ -24,27 +24,27 @@

         public void Dress()
         {
-            var item = UO.Items[Id];
-            if (item == null)
+            var item = UO.Items[Id];
+
+            if (item != null)
             {
-                UO.ClientPrint($"Cannot find item {Id}");
-                return;
+                UO.Log($"Dressing up {Specs.TranslateToName(item)}");
+                ContainerId = item.ContainerId;
             }
-
-            ContainerId = item.ContainerId;
-
-            UO.Log($"Dressing up {Specs.TranslateToName(item)}");
+            else
+                UO.Log($"Dressing up {Id}");
+
             UO.DragItem(Id);
             UO.Wear(Id, Layer);
         }

-        public void Undress(ObjectId defaultContainerId)
+        public void Undress(ObjectId defaultContainerId, bool forceDefault = false)
         {
             var item = UO.Items[Id];
             if (item == null)
                 UO.ClientPrint($"Cannot find {Id}");

-            var targetContainerId = ContainerId ?? defaultContainerId;
+            var targetContainerId = (forceDefault) ? defaultContainerId : ContainerId ?? defaultContainerId;

             UO.Log($"Undressing {Specs.TranslateToName(item)} -> {targetContainerId}");
             if (!Items.TryMoveItem(item, targetContainerId))
@@ -78,6 +78,19 @@
         }
     }

+    public void UndressTo()
+    {
+        var containerId = Common.AskForContainer("Select container to store equipment")?.Id;
+
+        if (!containerId.HasValue)
+        {
+            UO.ClientPrint("Undress cancelled.");
+            return;
+        }
+
+        Undress(containerId.Value, true);
+    }
+
     public void Undress()
     {
         var equipWithContainer = Equips.Where(x => x.HasContainer).FirstOrDefault();
@@ -88,12 +101,17 @@

         if (!defaultContainerId.HasValue)
             defaultContainerId = UO.Me.BackPack.Id;
-
+
+        Undress(defaultContainerId.Value, false);
+    }
+
+    public void Undress(uint defaultContainerId, bool forceDefault)
+    {
         UO.ClientPrint("Undressing set");

         foreach (var equip in Equips)
         {
-            equip.Undress(defaultContainerId.Value);
+            equip.Undress(defaultContainerId, forceDefault);
         }
     }

@@ -132,19 +150,24 @@

         if (!EquipmentSets.TryGetValue(name, out var equip))
         {
-            UO.ClientPrint($"Unknwon equip set '{name}'.");
+            UO.ClientPrint($"Unknown equip set '{name}'.");
             return null;
         }

         return equip;
-    }
-
+    }
+
     public static void DressEquipSet(string name)
     {
         var equipSet = GetEquipSet(name);
         if (equipSet == null)
             return;

+        var closedContainerIds = equipSet.Equips
+            .Where(x => x.HasContainer && UO.Items[x.Id] == null)
+            .Select(x => x.ContainerId.Value)
+            .Distinct();
+
         equipSet.Dress();
     }

@@ -155,6 +178,15 @@
             return;

         equipSet.Undress();
+    }
+
+    public static void UndressEquipSetTo(string name)
+    {
+        var equipSet = GetEquipSet(name);
+        if (equipSet == null)
+            return;
+
+        equipSet.UndressTo();
     }

     public static void RemoveEquipSet(string name)
@@ -187,5 +219,6 @@
 UO.RegisterCommand("equip-create", EquipSet.CreateSet);
 UO.RegisterCommand("equip-dress", EquipSet.DressEquipSet);
 UO.RegisterCommand("equip-undress", EquipSet.UndressEquipSet);
+UO.RegisterCommand("equip-undress-to", EquipSet.UndressEquipSetTo);
 UO.RegisterCommand("equip-list", EquipSet.ListEquipSets);
 UO.RegisterCommand("equip-remove", EquipSet.RemoveEquipSet);


Delete Crew.cs

Delete Crew.cs

--- src/Computer/Devices/Crew.cs
+++ src/Computer/Devices/Crew.cs
@@ -1,48 +0,0 @@
-// ====================================================================================================================
-// crew device
-// ====================================================================================================================
-
-
-using System;
-using System.Collections.Generic;
-using UnityEngine;
-
-
-namespace KERBALISM {
-
-
-public sealed class CrewDevice : Device
-{
-  public CrewDevice(ProtoCrewMember crew)
-  {
-    this.crew = crew;
-  }
-
-  public override string info()
-  {
-    kerbal_data kd = DB.KerbalData(crew.name);
-    int worst = 0;
-    foreach(Rule r in Kerbalism.rules)
-    {
-      double problem = kd.kmon[r.name].problem;
-      if (problem > r.danger_threshold) worst = Math.Max(worst, 2);
-      else if (problem > r.warning_threshold) worst = Math.Max(worst, 1);
-    }
-    switch(worst)
-    {
-      case 2: return "<color=red>danger</color>";
-      case 1: return "<color=yellow>warning</color>";
-      default: return "<color=green>healthy</color>";
-    }
-  }
-
-  public override void ctrl(double value)
-  {
-    // do nothing
-  }
-
-  ProtoCrewMember crew;
-}
-
-
-} // KERBALISM


Fixed indentation

Fixed indentation


Added IsValidUrl

Added IsValidUrl

git-svn-id: 36ffe9fc6fb3fc911a0fa1910eeaa8f32b731f7d@21889 81fbe566-5dc4-48c1-bdea-7421811ca204

--- ExtensionMethods/StringExtensions.cs
+++ ExtensionMethods/StringExtensions.cs
@@ -385,5 +385,13 @@
             return result;
         }
         #endregion
+
+        #region IsValidUrl
+        public static bool IsValidUrl(this string text)
+        {
+            Regex rx = new Regex(@"http(s)?://([\w-]+\.)+[\w-]+(/[\w- ./?%&=]*)?");
+            return rx.IsMatch(text);
+        }
+        #endregion
     }
 }


Stop recursion when handling data changes

Fixes issue 62, admittedly very hackily.


woops, opensans was hardcoded, bot wouldn't start


Adding SteamFriends.RequestUserInformation

--- Facepunch.Steamworks/SteamFriends.cs
+++ Facepunch.Steamworks/SteamFriends.cs
@@ -180,15 +180,23 @@
 		/// </summary>
 		public static void SetPlayedWith( SteamId steamid ) => Internal.SetPlayedWith( steamid );

+		/// <summary>
+		/// Requests the persona name and optionally the avatar of a specified user.
+		/// NOTE: It's a lot slower to download avatars and churns the local cache, so if you don't need avatars, don't request them.
+		/// returns true if we're fetching the data, false if we already have it
+		/// </summary>
+		public static bool RequestUserInformation( SteamId steamid, bool nameonly = true ) => Internal.RequestUserInformation( steamid, nameonly );
+
+
 		internal static async Task CacheUserInformationAsync( SteamId steamid, bool nameonly )
 		{
 			// Got it straight away, skip any waiting.
-			if ( !Internal.RequestUserInformation( steamid, nameonly ) )
+			if ( !RequestUserInformation( steamid, nameonly ) )
 				return;

 			await Task.Delay( 100 );

-			while ( Internal.RequestUserInformation( steamid, nameonly ) )
+			while ( RequestUserInformation( steamid, nameonly ) )
 			{
 				await Task.Delay( 50 );
 			}


Fixed warning - removed unused field

Fixed warning - removed unused field


Add messages

Add messages

--- FileSplitter/FileSplitter/Program.cs
+++ FileSplitter/FileSplitter/Program.cs
@@ -9,9 +9,21 @@
     {
         static void Main(string[] args)
         {
-            if (args.Length < 1) return;
+            if (args.Length < 1)
+            {
+                Console.WriteLine("Usage: FileSplitter <source-file-path>");
+                Console.WriteLine("Or, drag and drop the source file.");
+                return;
+            }

-            Split(args[0], Properties.Settings.Default.MaxSizeInMegabyte);
+            var sourceFilePath = args[0];
+            if (!File.Exists(sourceFilePath))
+            {
+                Console.WriteLine("The specified source file does not exist.");
+                return;
+            }
+
+            Split(sourceFilePath, Properties.Settings.Default.MaxSizeInMegabyte);
         }

         static void Split(string sourceFilePath, int maxSizeInMegabyte)


added flow control containers to executable node factory

--- src/CodeOwls.BIPS.Provider/ExecutableNodeFactory.cs
+++ src/CodeOwls.BIPS.Provider/ExecutableNodeFactory.cs
@@ -1,5 +1,6 @@
 using System.Collections.Generic;
 using System.Linq;
+using System.Runtime.InteropServices;
 using CodeOwls.PowerShell.Provider.PathNodeProcessors;
 using CodeOwls.PowerShell.Provider.PathNodes;
 using Microsoft.SqlServer.Dts.Pipeline.Wrapper;
@@ -7,6 +8,36 @@

 namespace CodeOwls.BIPS
 {
+    public class SequenceNodeFactory : NodeFactoryBase
+    {
+        private readonly Sequence _sequence;
+
+        public SequenceNodeFactory( Sequence sequence)
+        {
+            _sequence = sequence;
+        }
+
+        public override IEnumerable<INodeFactory> GetNodeChildren(IContext context)
+        {
+            var nodes = new List<INodeFactory>();
+            var exes = _sequence.Executables.Cast<Executable>().ToList();
+
+            nodes.AddRange(exes.ConvertAll(c => new ExecutableNodeFactory(c)));
+
+            return nodes;
+        }
+
+        public override IPathNode GetNodeValue()
+        {
+            return new ContainerPathNode( _sequence, Name );
+        }
+
+        public override string Name
+        {
+            get { return _sequence.Name; }
+        }
+    }
+
     public class ExecutableNodeFactory : NodeFactoryBase
     {
         private readonly DtsContainer _executable;
@@ -25,15 +56,28 @@

         public override IEnumerable<INodeFactory> GetNodeChildren(IContext context)
         {
-            if (null == _mainPipe)
+            var nodes = new List<INodeFactory>();
+            var seq = _executable as Sequence;
+            var foreachloop = _executable as ForEachLoop;
+            var forloop = _executable as ForLoop;
+
+            if (null != _mainPipe)
             {
-                return null;
+                var metadata = _mainPipe.ComponentMetaDataCollection.Cast<IDTSComponentMetaData100>();
+                nodes.AddRange(metadata.ToList().ConvertAll(c => new DataFlowComponentNodeFactory(c)));
             }
-
-            var nodes = new List<INodeFactory>();
-            var metadata = _mainPipe.ComponentMetaDataCollection.Cast<IDTSComponentMetaData100>();
-
-            nodes.AddRange(metadata.ToList().ConvertAll(c => new DataFlowComponentNodeFactory(c)));
+            else if (null != seq)
+            {
+                nodes.AddRange(seq.Executables.Cast<Executable>().ToList().ConvertAll( e=> new ExecutableNodeFactory(e)));
+            }
+            else if (null != foreachloop)
+            {
+                nodes.AddRange(foreachloop.Executables.Cast<Executable>().ToList().ConvertAll(e => new ExecutableNodeFactory(e)));
+            }
+            else if (null != forloop)
+            {
+                nodes.AddRange(forloop.Executables.Cast<Executable>().ToList().ConvertAll(e => new ExecutableNodeFactory(e)));
+            }

             return nodes;
         }


Fixed an issued caused by the promo/referral clean up push.

--- src/CodeRedCreations/Controllers/PartsController.cs
+++ src/CodeRedCreations/Controllers/PartsController.cs
@@ -78,10 +78,9 @@
             }

             // Promo
-            if (TempData["Promo"] != null)
-            {
-                viewModel.PromoModel = await _common.GetPromoAsync(int.Parse(TempData["Promo"].ToString()));
-                var promoPrice = ApplyPromoCode(viewModel);
+            if (viewModel.PromoModel != null)
+            {
+                var promoPrice = await ApplyPromoCode(viewModel);

                 if (viewModel.ProductModel.Price != promoPrice)
                 {
@@ -136,7 +135,7 @@
                 model.PromoModel = await _context.Promos.Include(x => x.ApplicableParts).FirstOrDefaultAsync(x => x.Id == model.PromoModel.Id);
                 var promo = model.PromoModel;
                 var timesUsed = promo.TimesUsed;
-                model.ProductModel.Price = ApplyPromoCode(model);
+                model.ProductModel.Price = await ApplyPromoCode(model);
                 timesUsed++;
                 await _context.SaveChangesAsync();
             }
@@ -205,20 +204,31 @@
             return RedirectToAction("Details", new { id = model.ProductModel.PartId });
         }

-        public decimal ApplyPromoCode(ProductDetailsView model)
-        {
+        public async Task<decimal> ApplyPromoCode(ProductDetailsView model)
+        {
+            if (model.PromoModel == null)
+            {
+                int promoId = int.Parse(TempData["Promo"].ToString());
+                model.PromoModel = await _context.Promos.FirstOrDefaultAsync(x => x.Id == promoId);
+            }
+
             var promo = model.PromoModel;
             var part = model.ProductModel;
             var price = part.Price;

+            // Valid Promo Check
             if (promo != null && promo.Enabled)
             {
+                // Usage Limit Check
                 if (promo.UsageLimit == null || promo.TimesUsed <= promo.UsageLimit)
                 {
+                    // Expiration Check
                     if (promo.ExpirationDate == null || promo.ExpirationDate > DateTime.UtcNow)
                     {
-                        if (promo.ApplicableParts.Count() == 0 || promo.ApplicableParts.FirstOrDefault(x => x.PartId == part.PartId) != null)
+                        // Applicable Part Check
+                        if (promo.ApplicableParts == null || promo.ApplicableParts.Count() == 0 || promo.ApplicableParts.FirstOrDefault(x => x.PartId == part.PartId) != null)
                         {
+                            // Valid Discount Amount
                             if (promo.DiscountAmount != null)
                             {
                                 price = Math.Round((price - (decimal)promo.DiscountAmount), 2);


Update ToolSelection.cs

Update ToolSelection.cs

--- src/Core2D/ViewModels/Editor/Tools/ToolSelection.cs
+++ src/Core2D/ViewModels/Editor/Tools/ToolSelection.cs
@@ -24,7 +24,6 @@
         private ToolSettingsSelection _settings;
         private State _currentState = State.None;
         private IRectangleShape _rectangleShape;
-        private IDecorator _decorator;
         private bool _previousDrawPoints = true;
         private double _startX;
         private double _startY;
@@ -221,23 +220,24 @@
                 _previousDrawPoints = editor.PageState.DrawPoints;
                 editor.PageState.DrawPoints = false;

-                if (_decorator != null)
+                if (editor.PageState.Decorator != null)
                 {
-                    _decorator.Shapes = shapes;
-                    _decorator.Update(true);
+                    editor.PageState.Decorator.Layer = editor.Project.CurrentContainer.WorkingLayer;
+                    editor.PageState.Decorator.Shapes = shapes;
+                    editor.PageState.Decorator.Update(true);
                 }
                 else
                 {
-                    _decorator = new BoxDecorator(
-                        _serviceProvider,
-                        shapes,
-                        editor.Project.CurrentContainer.WorkingLayer);
-                    _decorator.Show();
+                    editor.PageState.Decorator = new BoxDecorator(_serviceProvider);
+                    editor.PageState.Decorator.Layer = editor.Project.CurrentContainer.WorkingLayer;
+                    editor.PageState.Decorator.Shapes = shapes;
+                    editor.PageState.Decorator.Update(true);
+                    editor.PageState.Decorator.Show();
                 }

                 if (disableHitTest == false)
                 {
-                    bool result = _decorator.HitTest(args);
+                    bool result = editor.PageState.Decorator.HitTest(args);
                     if (result == true)
                     {
                         _currentState = State.Selected;
@@ -251,7 +251,7 @@
             }
         }

-        private void UpdateDecorator(IProjectEditor editor)
+        private void MoveDecorator(IProjectEditor editor)
         {
             if (editor.PageState == null)
             {
@@ -263,9 +263,9 @@
                 return;
             }

-            if (_decorator != null)
-            {
-                _decorator.Update(false);
+            if (editor.PageState.Decorator != null)
+            {
+                editor.PageState.Decorator.Update(false);
             }
         }

@@ -281,15 +281,11 @@
                 return;
             }

-            if (_decorator != null)
-            {
-                if (editor.PageState != null)
-                {
-                    editor.PageState.DrawPoints = _previousDrawPoints;
-                }
-
-                _decorator.Hide();
-                _decorator = null;
+            if (editor.PageState.Decorator != null)
+            {
+                editor.PageState.DrawPoints = _previousDrawPoints;
+                editor.PageState.Decorator.Hide();
+                editor.PageState.Decorator = null;
             }
         }

@@ -313,9 +309,9 @@

                         editor.Dehover(editor.Project.CurrentContainer.CurrentLayer);

-                        if (isControl == false && editor.PageState.DrawDecorators == true && _decorator != null)
-                        {
-                            bool result = _decorator.HitTest(args);
+                        if (isControl == false && editor.PageState.DrawDecorators == true && editor.PageState.Decorator != null)
+                        {
+                            bool result = editor.PageState.Decorator.HitTest(args);
                             if (result == true)
                             {
                                 _currentState = State.Selected;
@@ -380,6 +376,10 @@
                                             editor.PageState.SelectedShapes = null;
                                             ShowHideOrUpdateDecorator(editor, args, isControl);
                                         }
+                                        else
+                                        {
+                                            ShowHideOrUpdateDecorator(editor, args, isControl);
+                                        }
                                         editor.Project.CurrentContainer.CurrentLayer.Invalidate();
                                         break;
                                     }
@@ -589,10 +589,10 @@
                     break;
                 case State.Selected:
                     {
-                        if (editor.PageState.DrawDecorators == true && _decorator != null)
-                        {
-                            _decorator.Move(args);
-                            _decorator.Update(false);
+                        if (editor.PageState.DrawDecorators == true && editor.PageState.Decorator != null)
+                        {
+                            editor.PageState.Decorator.Move(args);
+                            editor.PageState.Decorator.Update(false);
                             return;
                         }

@@ -601,7 +601,7 @@
                         if (IsSelectionAvailable() && !isControl)
                         {
                             MoveSelectionCacheTo(args);
-                            UpdateDecorator(editor);
+                            MoveDecorator(editor);
                             editor.Project.CurrentContainer.CurrentLayer.Invalidate();
                             break;
                         }


Lock the shared document notification test state

--- src/Couchbase.Lite.Tests.Shared/NotificationTest.cs
+++ src/Couchbase.Lite.Tests.Shared/NotificationTest.cs
@@ -179,12 +179,15 @@
                 WriteLine($"Received {args.DocumentID}");
                 _wa.RunConditionalAssert(() =>
                 {
-                    _expectedDocumentChanges.Should()
-                        .Contain(args.DocumentID, "because otherwise a rogue notification came");
-                    _expectedDocumentChanges.Remove(args.DocumentID);
+                    lock (_expectedDocumentChanges) {
+                        _expectedDocumentChanges.Should()
+                            .Contain(args.DocumentID, "because otherwise a rogue notification came");
+                        _expectedDocumentChanges.Remove(args.DocumentID);

-                    WriteLine($"Expecting {_expectedDocumentChanges.Count} more changes ({JsonConvert.SerializeObject(_expectedDocumentChanges)}");
-                    return _expectedDocumentChanges.Count == 0;
+                        WriteLine(
+                            $"Expecting {_expectedDocumentChanges.Count} more changes ({JsonConvert.SerializeObject(_expectedDocumentChanges)})");
+                        return _expectedDocumentChanges.Count == 0;
+                    }
                 });
             }
         }


Harmonize name of agent session id

Harmonize name of agent session id

--- src/AspNetCore/Metrics/ActionMetricBase.cs
+++ src/AspNetCore/Metrics/ActionMetricBase.cs
@@ -252,6 +252,7 @@
         /// Id from JavaScript agent for session
         /// </summary>
         [EventMetricValue("AgentSessionId", SummaryFunction.Count, null, Caption = "Agent Session Id", Description = "Id from JavaScript agent for session")]
+        [JsonPropertyName("LoupeAgentSessionId")] //match MEL
         public string? AgentSessionId { get; }

         /// <summary>


Code formatting

Code formatting

--- src/CommandLine/Core/ArgumentsExtension.cs
+++ src/CommandLine/Core/ArgumentsExtension.cs
@@ -11,8 +11,10 @@
     static class ArgumentsExtension
     {
         public static IEnumerable<Error> Preprocess(
-            this IEnumerable<string> arguments, IEnumerable<Func<IEnumerable<string>,
-            IEnumerable<Error>>> preprocessorLookup)
+            this IEnumerable<string> arguments,
+            IEnumerable<
+                    Func<IEnumerable<string>, IEnumerable<Error>>
+                > preprocessorLookup)
         {
             if (preprocessorLookup.Empty())
             {


Refactoring with Head, Tail funcs :triumph:

--- src/CommandLine/Core/ArgumentsExtension.cs
+++ src/CommandLine/Core/ArgumentsExtension.cs
@@ -15,14 +15,15 @@
                     Func<IEnumerable<string>, IEnumerable<Error>>
                 > preprocessorLookup)
         {
-            if (preprocessorLookup.Empty())
-            {
-                return Enumerable.Empty<Error>();
-            }
-            var errors = preprocessorLookup.First()(arguments);
-            return errors.Any()
-                ? errors
-                : arguments.Preprocess(preprocessorLookup.Skip(1));
+            return preprocessorLookup.TryHead().Return(
+                func =>
+                    {
+                        var errors = func(arguments);
+                        return errors.Any()
+                            ? errors
+                            : arguments.Preprocess(preprocessorLookup.TailNoFail());
+                    },
+                Enumerable.Empty<Error>());
         }
     }
 }


Add 'html' to EmbedType enum

Add 'html' to EmbedType enum

This resolves #762.

This change adds an 'html' variant to the EmbedType enum.

This change also adds an 'Unknown' variant to the EmbedType enum (at
position -1); this will be used in a later commit to future-proof the
EmbedType enum from any further variants Discord may add.

--- src/Discord.Net.Core/Entities/Messages/EmbedType.cs
+++ src/Discord.Net.Core/Entities/Messages/EmbedType.cs
@@ -1,13 +1,15 @@
-namespace Discord
+namespace Discord
 {
     public enum EmbedType
     {
+        Unknown = -1,
         Rich,
         Link,
         Video,
         Image,
         Gifv,
         Article,
-        Tweet
+        Tweet,
+        Html,
     }
 }


Update CoreRT for changes in shared partition

Signed-off-by: dotnet-bot <03c4cb6107ae99956a7681f2c97ff7104809a2bd@microsoft.com>

--- src/Common/src/CoreLib/System/Activator.cs
+++ src/Common/src/CoreLib/System/Activator.cs
@@ -36,11 +36,6 @@
         public static object CreateInstance(Type type) =>
             CreateInstance(type, nonPublic: false);

-        [DebuggerHidden]
-        [DebuggerStepThrough]
-        public static object CreateInstance(Type type, bool nonPublic) =>
-            CreateInstance(type, nonPublic, wrapExceptions: true);
-
         public static ObjectHandle CreateInstanceFrom(string assemblyFile, string typeName) =>
             CreateInstanceFrom(assemblyFile, typeName, false, ConstructorDefault, null, null, null, null);


Fixed serialized the message type bug. (#53)

--- src/DotNetCore.CAP/Abstractions/CapPublisherBase.cs
+++ src/DotNetCore.CAP/Abstractions/CapPublisherBase.cs
@@ -68,10 +68,18 @@

         protected virtual string Serialize<T>(T obj, string callbackName = null)
         {
-            var serializer = (IContentSerializer)ServiceProvider.GetService(typeof(IContentSerializer));
             var packer = (IMessagePacker)ServiceProvider.GetService(typeof(IMessagePacker));

-            var content = serializer.Serialize(obj);
+            string content = string.Empty;
+            if (Helper.IsComplexType(obj.GetType()))
+            {
+                var serializer = (IContentSerializer)ServiceProvider.GetService(typeof(IContentSerializer));
+                content = serializer.Serialize(obj);
+            }
+            else
+            {
+                content = obj?.ToString();
+            }

             var message = new CapMessageDto(content)
             {


Added better logging for an error that could occur when adding or removing an oauth account.

--- src/Exceptionless.Api/Controllers/AuthController.cs
+++ src/Exceptionless.Api/Controllers/AuthController.cs
@@ -497,8 +497,10 @@
                 if (existingUser != null) {
                     if (existingUser.Id != CurrentUser.Id) {
                         // Existing user account is not the current user. Remove it and we'll add it to the current user below.
-                        if (!existingUser.RemoveOAuthAccount(userInfo.ProviderName, userInfo.Id))
+                        if (!existingUser.RemoveOAuthAccount(userInfo.ProviderName, userInfo.Id)) {
+                            _logger.Error().Message("Unable to remove existing oauth account for existing user \"{0}\"", existingUser.EmailAddress).Tag("External Login").Identity(CurrentUser.EmailAddress).Property("User Info", userInfo).Property("User", CurrentUser).Property("ExistingUser", existingUser).SetActionContext(ActionContext).Write();
                             return null;
+                        }

                         await _userRepository.SaveAsync(existingUser, true);
                     } else {


Simplified.

Simplified.

--- src/Cuemon.Extensions.Xunit.Hosting.AspNetCore/Http/Features/FakeHttpResponseFeature.cs
+++ src/Cuemon.Extensions.Xunit.Hosting.AspNetCore/Http/Features/FakeHttpResponseFeature.cs
@@ -12,8 +12,6 @@
     public class FakeHttpResponseFeature : HttpResponseFeature
     {
         private bool _hasStarted;
-        private Func<object, Task> _callback;
-        private object _state;

         /// <summary>
         /// Initializes a new instance of the <see cref="FakeHttpResponseFeature"/> class.
@@ -24,29 +22,15 @@
         }

         /// <summary>
-        /// Registers a callback to be invoked just before the response starts. This is the
-        /// last chance to modify the <see cref="P:Microsoft.AspNetCore.Http.Features.IHttpResponseFeature.Headers" />, <see cref="P:Microsoft.AspNetCore.Http.Features.IHttpResponseFeature.StatusCode" />, or
-        /// <see cref="P:Microsoft.AspNetCore.Http.Features.IHttpResponseFeature.ReasonPhrase" />.
+        /// Registers a callback to be invoked just before the response starts. This is the last chance to modify the <see cref="P:Microsoft.AspNetCore.Http.Features.IHttpResponseFeature.Headers" />, <see cref="P:Microsoft.AspNetCore.Http.Features.IHttpResponseFeature.StatusCode" />, or <see cref="P:Microsoft.AspNetCore.Http.Features.IHttpResponseFeature.ReasonPhrase" />.
         /// </summary>
         /// <param name="callback">The callback to invoke when starting the response.</param>
         /// <param name="state">The state to pass into the callback.</param>
         public override void OnStarting(Func<object, Task> callback, object state)
         {
-            if (_hasStarted) { return; }
-            if (ShortCircuitOnStarting)
-            {
-                _hasStarted = true;
-                callback?.Invoke(state);
-            }
-            _callback = callback;
-            _state = state;
+            _hasStarted = true;
+            callback?.Invoke(state);
         }
-
-        /// <summary>
-        /// Gets a value indicating whether this instance has <see cref="OnStarting"/> callback.
-        /// </summary>
-        /// <value><c>true</c> if this instance has <see cref="OnStarting"/> callback; otherwise, <c>false</c>.</value>
-        public bool HasOnStartingCallback => _callback != null;

         /// <summary>
         /// Indicates if the response has started. If true, the <see cref="P:Microsoft.AspNetCore.Http.Features.IHttpResponseFeature.StatusCode" />,
@@ -55,21 +39,5 @@
         /// </summary>
         /// <value><c>true</c> if this instance has started; otherwise, <c>false</c>.</value>
         public override bool HasStarted => _hasStarted;
-
-        /// <summary>
-        /// Gets or sets a value indicating whether <see cref="OnStarting"/> is invoked immediately upon initialization.
-        /// </summary>
-        /// <value><c>true</c> if <see cref="OnStarting"/> is invoked immediately upon initialization; otherwise, <c>false</c>.</value>
-        public bool ShortCircuitOnStarting { get; set; }
-
-        /// <summary>
-        /// Executes the function delegate assigned by <see cref="OnStarting"/>.
-        /// </summary>
-        /// <returns>A task that represents the asynchronous operation.</returns>
-        public Task TriggerOnStartingAsync()
-        {
-            _hasStarted = true;
-            return HasOnStartingCallback ? _callback(_state) : Task.CompletedTask;
-        }
     }
 }


Added data to exception object.

Added data to exception object.

--- src/Extensions/Nimbus.Transports.WindowsServiceBus/QueueManagement/AzureQueueManager.cs
+++ src/Extensions/Nimbus.Transports.WindowsServiceBus/QueueManagement/AzureQueueManager.cs
@@ -314,7 +314,8 @@

                                   // SubCode=40901. Another conflicting operation is in progress. Let's see if it's created the queue for us.
                                   if (!_namespaceManager().QueueExists(queuePath))
-                                      throw new BusException("Queue creation for '{0}' failed".FormatWith(queuePath), exc);
+                                      throw new BusException($"Queue creation for '{queuePath}' failed due to a conflicting operation and that queue does not already exist.", exc)
+                                          .WithData("QueuePath", queuePath);
                               }

                               _knownQueues.Value.Add(queuePath);


change base type of SecurityTokenUnableToValidateException

--- src/Microsoft.IdentityModel.Tokens/Exceptions/SecurityTokenUnableToValidateException.cs
+++ src/Microsoft.IdentityModel.Tokens/Exceptions/SecurityTokenUnableToValidateException.cs
@@ -36,7 +36,7 @@
     /// to refresh keys.
     /// </summary>
     [Serializable]
-    public class SecurityTokenUnableToValidateException : SecurityTokenException
+    public class SecurityTokenUnableToValidateException : SecurityTokenInvalidSignatureException
     {
         [NonSerialized]
         const string _Prefix = "Microsoft.IdentityModel." + nameof(SecurityTokenUnableToValidateException) + ".";


Fixed wrong condition

Fixed wrong condition

--- src/AvaloniaEdit.TextMate/TextMateColoringTransformer.cs
+++ src/AvaloniaEdit.TextMate/TextMateColoringTransformer.cs
@@ -184,13 +184,11 @@
                 lastChangedLineIndex = Math.Max(range.toLineNumber - 1, lastChangedLineIndex);
             }

-            bool areChangedLinesVisible =
-                firstChangedLineIndex >= _firstVisibleLineIndex ||
-                lastChangedLineIndex >= _firstVisibleLineIndex ||
-                firstChangedLineIndex <= _lastVisibleLineIndex ||
-                lastChangedLineIndex <= _lastVisibleLineIndex;
-
-            if (!areChangedLinesVisible)
+            bool changedLinesAreNotVisible =
+                (firstChangedLineIndex < _firstVisibleLineIndex && lastChangedLineIndex < _firstVisibleLineIndex) ||
+                (firstChangedLineIndex > _lastVisibleLineIndex && lastChangedLineIndex > _lastVisibleLineIndex);
+
+            if (changedLinesAreNotVisible)
                 return;

             Dispatcher.UIThread.Post(() =>


Fixed bad RPC proxy url

Fixed bad RPC proxy url

--- src/Discord.Net/API/DiscordRpcAPIClient.cs
+++ src/Discord.Net/API/DiscordRpcAPIClient.cs
@@ -1,6 +1,4 @@
 using Discord.API.Rpc;
-using Discord.Logging;
-using Discord.Net.Converters;
 using Discord.Net.Queue;
 using Discord.Net.Rest;
 using Discord.Net.WebSockets;
@@ -8,8 +6,6 @@
 using Newtonsoft.Json.Linq;
 using System;
 using System.Collections.Concurrent;
-using System.Diagnostics;
-using System.Globalization;
 using System.IO;
 using System.IO.Compression;
 using System.Text;
@@ -158,7 +154,7 @@
                     {
                         string url = $"wss://discordapp.io:{port}/?v={DiscordRpcConfig.RpcAPIVersion}&client_id={_clientId}";
                         await _webSocketClient.ConnectAsync(url).ConfigureAwait(false);
-                        SetBaseUrl($"https://discordapp.io:{port}");
+                        SetBaseUrl($"https://discordapp.io:{port}/");
                         success = true;
                         break;
                     }


add multi items transfer back test

add multi items transfer back test

--- source/ChakraCore.NET.UnitTest/ComplexProxyTest.cs
+++ source/ChakraCore.NET.UnitTest/ComplexProxyTest.cs
@@ -2,6 +2,7 @@
 using System;
 using System.Collections.Generic;
 using System.Text;
+using System.Linq;

 namespace ChakraCore.NET.UnitTest
 {
@@ -27,6 +28,13 @@
                 target = target + i.ToString() + ",";
             }
             context.RootObject.WriteProperty<IEnumerable<TestProxy>>("proxies", items);
+
+            var items_back=context.RootObject.ReadProperty<IEnumerable<TestProxy>>("proxies").ToArray();
+            Assert.AreEqual(items_back.Length, items.Length);
+            for (int i = 0; i < items.Length; i++)
+            {
+                Assert.AreSame(items[i], items_back[i]);
+            }
             string result=context.RootObject.CallFunction<string>("MultiTransfer");
             Assert.AreEqual<string>(target, result);
         }


change return type to new object

change return type to new object

--- CodeGenerationPercentage.Tests/UnitTest1.cs
+++ CodeGenerationPercentage.Tests/UnitTest1.cs
@@ -36,13 +36,13 @@
                 codeFiles.Add(codeFile);
             }

-            var percentage = CalculatePercentage(codeFiles);
+            var stats = CalculatePercentage(codeFiles);

             Assert.AreEqual(7, codeFiles.Count);
-            Assert.AreEqual(57.15, percentage, 0.01); // 7*12=84 4*12=48 100/84*48 =
+            Assert.AreEqual(57.15, stats.PercentageGeneratedLines(stats), 0.01); // 7*12=84 4*12=48 100/84*48 =
         }

-        private double CalculatePercentage(List<CodeFile> codeFiles)
+        private OverallStats CalculatePercentage(List<CodeFile> codeFiles)
         {
             var stats = new OverallStats();

@@ -63,7 +63,7 @@
                 }
             }

-            return stats.PercentageGeneratedLines(stats);
+            return stats;
         }

         [Test]


Add some test logging

Add some test logging

--- src/Foundatio.TestHarness/Jobs/JobQueueTestsBase.cs
+++ src/Foundatio.TestHarness/Jobs/JobQueueTestsBase.cs
@@ -48,15 +48,20 @@
             using (var queue = GetSampleWorkItemQueue(retries: 3, retryDelay: TimeSpan.Zero)) {
                 await queue.DeleteQueueAsync();

-                var enqueueTask = Run.InParallelAsync(workItemCount, index => queue.EnqueueAsync(new SampleQueueWorkItem {
+                var enqueueTask = Run.InParallelAsync(workItemCount, index => {
+                    _logger.LogInformation($"Enqueue #{index}");
+                    return queue.EnqueueAsync(new SampleQueueWorkItem {
                         Created = SystemClock.UtcNow,
                         Path = "somepath" + index
-                    }));
+                    });
+                });

                 var lockProvider = new ThrottlingLockProvider(new InMemoryCacheClient(new InMemoryCacheClientOptions()), allowedLockCount, TimeSpan.FromDays(1), Log);
                 var job = new SampleQueueJobWithLocking(queue, null, lockProvider, Log);
                 await SystemClock.SleepAsync(10);
+                _logger.LogInformation("Starting RunUntilEmptyAsync");
                 await Task.WhenAll(job.RunUntilEmptyAsync(), enqueueTask);
+                _logger.LogInformation("Done RunUntilEmptyAsync");

                 var stats = await queue.GetQueueStatsAsync();
                 Assert.Equal(0, stats.Queued);


Code clean up

Code clean up

--- cli/src/MsgPack/StreamUnpacker.cs
+++ cli/src/MsgPack/StreamUnpacker.cs
@@ -120,7 +120,6 @@
 		/// </remarks>
 		public MessagePackObject? Unpack( Stream source, UnpackingMode unpackingMode )
 		{
-#warning UnpackingMode
 			// FIXME:BULK LOAD
 			Contract.Assert( source != null );


removed manual string split

removed manual string split

--- src/Dotnet.Script/Program.cs
+++ src/Dotnet.Script/Program.cs
@@ -41,10 +41,6 @@

             app.HelpOption("-? | -h | --help");

-            var scriptArgsMarkerIndex = Array.FindIndex(args, arg => arg == "--");
-            var argCount = scriptArgsMarkerIndex >= 0 ? scriptArgsMarkerIndex : args.Length;
-            var scriptArgs = args.Skip(argCount + 1);
-
             app.Command("eval", c =>
             {
                 c.Description = "Execute CSX code.";
@@ -55,7 +51,7 @@
                 {
                     if (!string.IsNullOrWhiteSpace(code.Value))
                     {
-                        RunCode(code.Value, config.HasValue() ? config.Value() : "Release", debugMode.HasValue(), scriptArgs, cwd.Value());
+                        RunCode(code.Value, config.HasValue() ? config.Value() : "Release", debugMode.HasValue(), app.RemainingArguments, cwd.Value());
                     }
                     return 0;
                 });
@@ -65,8 +61,7 @@
             {
                 if (!string.IsNullOrWhiteSpace(file.Value))
                 {
-                    RunScript(file.Value, config.HasValue() ? config.Value() : "Release", debugMode.HasValue(),
-                        scriptArgs);
+                    RunScript(file.Value, config.HasValue() ? config.Value() : "Release", debugMode.HasValue(), app.RemainingArguments);
                 }
                 else
                 {
@@ -75,7 +70,7 @@
                 return 0;
             });

-            return app.Execute(args.Take(argCount).ToArray());
+            return app.Execute(args.Except(new[] { "--" }).ToArray());
         }

         private static void RunScript(string file, string config, bool debugMode, IEnumerable<string> args)


remove add country endpoint

remove add country endpoint

--- sapHowmuch.Api.Web/Controllers/CountryController.cs
+++ sapHowmuch.Api.Web/Controllers/CountryController.cs
@@ -78,34 +78,35 @@
 			return NotFound();
 		}

-		/// <summary>
-		/// Add country
-		/// </summary>
-		/// <param name="request"></param>
-		/// <returns></returns>
-		[HttpPost]
-		[Route("add")]
-		public async Task<CountryCreateResponse> AddCountry(CountryCreateRequest request)
-		{
-			var eventStreamRequest = new EventStreamCreateRequest() { StreamId = Guid.NewGuid() };
-			var eventStreamResponse = await this._service.CreateEventStreamAsync(eventStreamRequest);
+		///// 2017-07-11 국가 코드 추가는 사용하지 않음
+		///// <summary>
+		///// Add country
+		///// </summary>
+		///// <param name="request"></param>
+		///// <returns></returns>
+		//[HttpPost]
+		//[Route("add")]
+		//public async Task<CountryCreateResponse> AddCountry(CountryCreateRequest request)
+		//{
+		//	var eventStreamRequest = new EventStreamCreateRequest() { StreamId = Guid.NewGuid() };
+		//	var eventStreamResponse = await this._service.CreateEventStreamAsync(eventStreamRequest);

-			CountryCreateResponse response;
+		//	CountryCreateResponse response;

-			if (eventStreamResponse.Error != null)
-			{
-				response = new CountryCreateResponse()
-				{
-					Error = eventStreamResponse.Error
-				};
+		//	if (eventStreamResponse.Error != null)
+		//	{
+		//		response = new CountryCreateResponse()
+		//		{
+		//			Error = eventStreamResponse.Error
+		//		};

-				return await Task.FromResult(response);
-			}
+		//		return await Task.FromResult(response);
+		//	}

-			request.StreamId = eventStreamResponse.Data.StreamId;
-			response = await this._service.CreateCountryAsync(request);
+		//	request.StreamId = eventStreamResponse.Data.StreamId;
+		//	response = await this._service.CreateCountryAsync(request);

-			return await Task.FromResult(response);
-		}
+		//	return await Task.FromResult(response);
+		//}
 	}
 }


Make code more readable

Make code more readable

--- src/AvaloniaEdit.TextMate/TextMateColoringTransformer.cs
+++ src/AvaloniaEdit.TextMate/TextMateColoringTransformer.cs
@@ -218,13 +218,15 @@
                 lastChangedLineIndex = Math.Max(range.ToLineNumber - 1, lastChangedLineIndex);
             }

-            bool changedLinesAreNotVisible =
-                _areVisualLinesValid &&
-                ((firstChangedLineIndex < _firstVisibleLineIndex && lastChangedLineIndex < _firstVisibleLineIndex) ||
-                (firstChangedLineIndex > _lastVisibleLineIndex && lastChangedLineIndex > _lastVisibleLineIndex));
-
-            if (changedLinesAreNotVisible)
-                return;
+            if (_areVisualLinesValid)
+            {
+                bool changedLinesAreNotVisible =
+                    ((firstChangedLineIndex < _firstVisibleLineIndex && lastChangedLineIndex < _firstVisibleLineIndex) ||
+                    (firstChangedLineIndex > _lastVisibleLineIndex && lastChangedLineIndex > _lastVisibleLineIndex));
+
+                if (changedLinesAreNotVisible)
+                    return;
+            }

             Dispatcher.UIThread.Post(() =>
             {


fix IDictContext.FirstContext()

fix IDictContext.FirstContext()

--- Scripts/DapCore/context_/ContextExtension.cs
+++ Scripts/DapCore/context_/ContextExtension.cs
@@ -102,20 +102,20 @@
         public static T FirstContext<T>(this IDictContext context, Func<T, bool> callback, bool isDebug = false)
                                                     where T : class, IContext {
             T result = null;
-            TreeHelper.ForEachDescendants<T>(context, (IContext element) => {
+            TreeHelper.ForEachDescendants<T>(context, (T element) => {
                 if (result == null && callback(element)) {
                     result = element;
                 }
             });
             if (result == null) {
-                ErrorOrDebug(isDebug, "First<{0}>({1}): Not Found", typeof(T).FullName, callback);
+                context.ErrorOrDebug(isDebug, "First<{0}>({1}): Not Found", typeof(T).FullName, callback);
             }
             return result;
         }

         public static T FirstContext<T>(this IDictContext context, bool isDebug = false)
                                                     where T : class, IContext {
-            return FirstContext<T>((T element) => { return true; });
+            return FirstContext<T>(context, (T element) => { return true; });
         }

         public static T AddContext<TO, T>(this IDictContext context, string relPath)


IsReady check has been added to the DeviceDetectionManager.

--- src/Domain/Demo/Models/VisitInformation.cs
+++ src/Domain/Demo/Models/VisitInformation.cs
@@ -58,10 +58,11 @@
     private DeviceInformation GetDeviceInformation()
     {
       this._isDeviceLookupDone = true;
-      if (!DeviceDetectionManager.IsEnabled || string.IsNullOrEmpty(Tracker.Current.Interaction.UserAgent))
+      if (!DeviceDetectionManager.IsEnabled || !DeviceDetectionManager.IsReady || string.IsNullOrEmpty(Tracker.Current.Interaction.UserAgent))
       {
         return null;
       }
+
       return DeviceDetectionManager.GetDeviceInformation(Tracker.Current.Interaction.UserAgent);
     }


Reverted previous commits

Reverted previous commits

--- src/Framework/Razor/Web/Mvc/DynamicContentHelper.cs
+++ src/Framework/Razor/Web/Mvc/DynamicContentHelper.cs
@@ -28,10 +28,7 @@
         {
             get
 			{
-				if (Html.IsRegistering())
-					return new HasValueHelper(x => true);
-				else
-					return new HasValueHelper(HasValue);
+				return new HasValueHelper(HasValue);
 			}
         }


Add TraceLog test.

Add TraceLog test.

--- src/Eff.Tests/EffectTests.cs
+++ src/Eff.Tests/EffectTests.cs
@@ -152,6 +152,28 @@
             var ex = Foo(0).Exception;
             Assert.IsType<DivideByZeroException>(ex.InnerException);
             Assert.Equal(1, handler.ExceptionLogs.Count);
+            Assert.Equal(ex.InnerException, handler.ExceptionLogs[0].Exception);
+        }
+
+        [Fact]
+        public void TestTraceLog()
+        {
+            async EffTask<int> Bar(int x)
+            {
+                return x + 1;
+            }
+
+            async EffTask<int> Foo(int x)
+            {
+                var y = await Bar(x).AsEffect();
+                return y;
+            }
+            var handler = new TestEffectHandler();
+            EffectExecutionContext.Handler = handler;
+            var result = Foo(1).Result;
+            Assert.Equal(2, result);
+            Assert.Equal(1, handler.TraceLogs.Count);
+            Assert.Equal(result, (int)handler.TraceLogs[0].Result);
         }

     }


Update src/NetAnalyzers/Core/Microsoft.NetFramework.Analyzers/DoNotUseInsecureDtdProcessing.cs

Co-authored-by: Paul Ming <0254e5b8a6e4f3807ffaed754aab467bd200ff41@microsoft.com>

--- src/NetAnalyzers/Core/Microsoft.NetFramework.Analyzers/DoNotUseInsecureDtdProcessing.cs
+++ src/NetAnalyzers/Core/Microsoft.NetFramework.Analyzers/DoNotUseInsecureDtdProcessing.cs
@@ -348,7 +348,7 @@

                 // initial XmlResolver secure value dependent on whether framework version secure
                 // < .NET 4.5.2 insecure - XmlDocument would set XmlResolver as XmlUrlResolver
-                // > .NET 4.5.2 secure - XmlDocument would set XmlResolver as null
+                // >= .NET 4.5.2 secure - XmlDocument would set XmlResolver as null
                 bool isXmlDocumentSecureResolver = _isFrameworkSecure;

                 if (!Equals(objCreation.Constructor.ContainingType, _xmlTypes.XmlDocument))


Update WebAssemblyAuthenticationTests.cs (#35089)

--- src/Components/test/E2ETest/Tests/WebAssemblyAuthenticationTests.cs
+++ src/Components/test/E2ETest/Tests/WebAssemblyAuthenticationTests.cs
@@ -90,6 +90,7 @@
         }

         [Fact]
+        [QuarantinedTest("https://github.com/dotnet/aspnetcore/issues/34995")]
         public void CanPreserveApplicationState_DuringLogIn()
         {
             var originalAppState = Browser.Exists(By.Id("app-state")).Text;


Removal of unused files

Removal of unused files

--- src/FubarDev.FtpServer.Commands/FtpLogExtensions.cs
+++ src/FubarDev.FtpServer.Commands/FtpLogExtensions.cs
@@ -16,95 +16,6 @@
     /// </summary>
     internal static class FtpLogExtensions
     {
-        /// <summary>
-        /// Logs a trace message with the data of the <see cref="FtpCommand"/>.
-        /// </summary>
-        /// <param name="log">The <see cref="ILogger"/> to use.</param>
-        /// <param name="command">The <see cref="FtpCommand"/> to log.</param>
-        public static void Trace([NotNull] this ILogger log, [NotNull] FtpCommand command)
-        {
-            log.LogTrace("{0}", command);
-        }
-
-        /// <summary>
-        /// Logs a trace message with the data of the <see cref="FtpResponse"/>.
-        /// </summary>
-        /// <param name="log">The <see cref="ILogger"/> to use.</param>
-        /// <param name="response">The <see cref="FtpResponse"/> to log.</param>
-        public static void Trace([NotNull] this ILogger log, [NotNull] FtpResponse response)
-        {
-            log.LogTrace("{0}", response);
-        }
-
-        /// <summary>
-        /// Logs a debug message with the data of the <see cref="FtpResponse"/>.
-        /// </summary>
-        /// <param name="log">The <see cref="ILogger"/> to use.</param>
-        /// <param name="response">The <see cref="FtpResponse"/> to log.</param>
-        public static void Debug([NotNull] this ILogger log, [NotNull] FtpResponse response)
-        {
-            log.LogDebug("{0}", response);
-        }
-
-        /// <summary>
-        /// Logs a info message with the data of the <see cref="FtpResponse"/>.
-        /// </summary>
-        /// <param name="log">The <see cref="ILogger"/> to use.</param>
-        /// <param name="response">The <see cref="FtpResponse"/> to log.</param>
-        public static void Info([NotNull] this ILogger log, [NotNull] FtpResponse response)
-        {
-            log.LogDebug("{0}", response);
-        }
-
-        /// <summary>
-        /// Logs a warning message with the data of the <see cref="FtpResponse"/>.
-        /// </summary>
-        /// <param name="log">The <see cref="ILogger"/> to use.</param>
-        /// <param name="response">The <see cref="FtpResponse"/> to log.</param>
-        public static void Warn([NotNull] this ILogger log, [NotNull] FtpResponse response)
-        {
-            log.LogWarning("{0}", response);
-        }
-
-        /// <summary>
-        /// Logs an error message with the data of the <see cref="FtpResponse"/>.
-        /// </summary>
-        /// <param name="log">The <see cref="ILogger"/> to use.</param>
-        /// <param name="response">The <see cref="FtpResponse"/> to log.</param>
-        public static void Error([NotNull] this ILogger log, [NotNull] FtpResponse response)
-        {
-            log.LogError("{0}", response);
-        }
-
-        /// <summary>
-        /// Logs a message with the data of the <see cref="FtpResponse"/>.
-        /// </summary>
-        /// <param name="log">The <see cref="ILogger"/> to use.</param>
-        /// <param name="response">The <see cref="FtpResponse"/> to log.</param>
-        /// <remarks>
-        /// It logs either a trace, debug, or warning message depending on the
-        /// <see cref="FtpResponse.Code"/>.
-        /// </remarks>
-        public static void Log([NotNull] this ILogger log, [NotNull] FtpResponse response)
-        {
-            if (response.Code >= 200 && response.Code < 300)
-            {
-                log.Trace(response);
-            }
-            else if (response.Code >= 300 && response.Code < 400)
-            {
-                log.Info(response);
-            }
-            else if (response.Code < 200)
-            {
-                log.Debug(response);
-            }
-            else
-            {
-                log.Warn(response);
-            }
-        }
-
 #if NETSTANDARD1_3
         internal static void LogError(
             [NotNull] this ILogger log,


Update test json

Update test json

--- src/DownloadCharts/Views/Home/Index.cshtml
+++ src/DownloadCharts/Views/Home/Index.cshtml
@@ -9,22 +9,92 @@
 @section scripts
 {
     <script>
-        var datasource = [{
-            type: 'us', count: 20, date: '12-2013'
-        }, {
-            type: 'us', count: 10, date: '01-2014'
-        }, {
-            type: 'bug', count: 15, date: '02-2014'
-        }, {
-            type: 'bug', count: 23, date: '05-2014'
-        }];
+        var datasource = [
+  {
+      "createDate": "2015-05-23T00:00:00",
+      "releaseDate": "2015-01-27T00:00:00",
+      "isAlpha": true,
+      "isBeta": true,
+      "isStable": true,
+      "isWebsite": false,
+      "file": "\"/XamarinforVisualStudio/Windows/Xamarin.VisualStudio_3.9.289.msi\"",
+      "total": 57,
+      "version": "3.9.289"
+  },
+  {
+      "createDate": "2015-05-24T00:00:00",
+      "releaseDate": "2015-01-27T00:00:00",
+      "isAlpha": true,
+      "isBeta": true,
+      "isStable": true,
+      "isWebsite": false,
+      "file": "\"/XamarinforVisualStudio/Windows/Xamarin.VisualStudio_3.9.289.msi\"",
+      "total": 63,
+      "version": "3.9.289"
+  },
+  {
+      "createDate": "2015-05-25T00:00:00",
+      "releaseDate": "2015-01-27T00:00:00",
+      "isAlpha": true,
+      "isBeta": true,
+      "isStable": true,
+      "isWebsite": false,
+      "file": "\"/XamarinforVisualStudio/Windows/Xamarin.VisualStudio_3.9.289.msi\"",
+      "total": 65,
+      "version": "3.9.289"
+  },
+    {
+        "createDate": "2015-05-23T00:00:00",
+        "releaseDate": "2014-09-29T00:00:00",
+        "isAlpha": true,
+        "isBeta": true,
+        "isStable": false,
+        "isWebsite": false,
+        "file": "\"/XamarinforVisualStudio/Windows/Xamarin.VisualStudio_Setup-3.7.165.msi\"",
+        "total": 33,
+        "version": "3.7.165"
+    },
+  {
+      "createDate": "2015-05-24T00:00:00",
+      "releaseDate": "2014-09-29T00:00:00",
+      "isAlpha": true,
+      "isBeta": true,
+      "isStable": false,
+      "isWebsite": false,
+      "file": "\"/XamarinforVisualStudio/Windows/Xamarin.VisualStudio_Setup-3.7.165.msi\"",
+      "total": 25,
+      "version": "3.7.165"
+  },
+  {
+      "createDate": "2015-05-25T00:00:00",
+      "releaseDate": "2014-09-29T00:00:00",
+      "isAlpha": true,
+      "isBeta": true,
+      "isStable": false,
+      "isWebsite": false,
+      "file": "\"/XamarinforVisualStudio/Windows/Xamarin.VisualStudio_Setup-3.7.165.msi\"",
+      "total": 5,
+      "version": "3.7.165"
+  }
+];

         var chart = new tauCharts.Chart({
             data: datasource,
+            dimentions: {
+                createDate: {
+                    type: 'order',
+                    scale: 'period'
+                },
+                guide: {
+                    x: { tickPeriod: 'quarter', tickFormat: 'day' }
+                    // tickPeriod indicates that every tick is a quarter, while tickFormat sets how tick value will be displayed
+                    // In this example we will have quarters with first day of the quarter: 01-Jan-2014, 01-Apr-2014, 01-Jul-2014, 01-Oct-2014...
+                }
+            },
             type: 'line',
-            x: 'date',
-            y: 'count',
-            color: 'type' // there will be two lines with different colors on the chart
+            x: 'createDate',
+            y: 'total',
+            color: 'file'
         });

         chart.renderTo('#line');


Hopefully fixing websites test loading in netcore on linux.

--- src/ResourceManager/Websites/Commands.Websites.Test/ScenarioTests/WebsitesController.cs
+++ src/ResourceManager/Websites/Commands.Websites.Test/ScenarioTests/WebsitesController.cs
@@ -111,7 +111,7 @@
                     _helper.RMProfileModule,
                     _helper.RMStorageDataPlaneModule,
                     _helper.RMResourceModule,
-                    _helper.GetRMModulePath(@"AzureRM.WebSites.psd1"),
+                    _helper.GetRMModulePath(@"AzureRM.Websites.psd1"),
                     "AzureRM.Storage.ps1",
                     "AzureRM.Resources.ps1");


修改引用命名空间名称

修改引用命名空间名称

--- src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/MessageHandlers/WxOpenMessageHandler.cs
+++ src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/MessageHandlers/WxOpenMessageHandler.cs
@@ -37,7 +37,7 @@
 using Senparc.Weixin.MessageHandlers;
 using Senparc.Weixin.WxOpen.Entities;
 using Senparc.Weixin.WxOpen.Entities.Request;
-using Tencent;
+using Senparc.Weixin.WxOpen.Tencent;
 //using IRequestMessageBase = Senparc.Weixin.WxOpen.Entities.IRequestMessageBase;

 namespace Senparc.Weixin.WxOpen.MessageHandlers


Add info to health contributor details when configured as disabled

--- src/Steeltoe.Extensions.Configuration.ConfigServerBase/ConfigServerHealthContributor.cs
+++ src/Steeltoe.Extensions.Configuration.ConfigServerBase/ConfigServerHealthContributor.cs
@@ -57,6 +57,7 @@
             {
                 Logger?.LogDebug("Config server health check disabled");
                 health.Status = HealthStatus.UNKNOWN;
+                health.Details.Add("info", "Health check disabled");
                 return health;
             }


Add logging to Config Server health contributor

--- src/Steeltoe.Extensions.Configuration.ConfigServerBase/ConfigServerHealthContributor.cs
+++ src/Steeltoe.Extensions.Configuration.ConfigServerBase/ConfigServerHealthContributor.cs
@@ -47,6 +47,7 @@

             if (Provider == null)
             {
+                Logger?.LogDebug("No config server provider found");
                 health.Status = HealthStatus.UNKNOWN;
                 health.Details.Add("error", "No config server provider found");
                 return health;
@@ -54,6 +55,7 @@

             if (!IsEnabled())
             {
+                Logger?.LogDebug("Config server health check disabled");
                 health.Status = HealthStatus.UNKNOWN;
                 return health;
             }
@@ -61,6 +63,7 @@
             IList<PropertySource> sources = GetPropertySources();
             if (sources == null || sources.Count == 0)
             {
+                Logger?.LogDebug("No property sources found");
                 health.Status = HealthStatus.UNKNOWN;
                 health.Details.Add("error", "No property sources found");
                 return health;
@@ -72,10 +75,13 @@

         internal void UpdateHealth(HealthCheckResult health, IList<PropertySource> sources)
         {
+            Logger?.LogDebug("Config server health check returning UP");
+
             health.Status = HealthStatus.UP;
             List<string> names = new List<string>();
             foreach (var source in sources)
             {
+                Logger?.LogDebug("Returning property source: {propertySource}", source.Name);
                 names.Add(source.Name);
             }

@@ -88,6 +94,7 @@
             if (IsCacheStale(currentTime))
             {
                 LastAccess = currentTime;
+                Logger?.LogDebug("Cache stale, fetching config server health");
                 Cached = Provider.Load(false);
             }


suppress incorrect code warning

suppress incorrect code warning

--- Common/Utilities/ObjectReferenceComparer.cs
+++ Common/Utilities/ObjectReferenceComparer.cs
@@ -1,4 +1,5 @@
 using System.Collections.Generic;
+using System.Diagnostics.CodeAnalysis;
 using System.Runtime.CompilerServices;

 namespace Pathoschild.Stardew.Common.Utilities
@@ -21,6 +22,7 @@

         /// <summary>Get a hash code for the specified object.</summary>
         /// <param name="obj">The value.</param>
+        [SuppressMessage("MicrosoftCodeAnalysisCorrectness", "RS1024:Compare symbols correctly", Justification = "Comparing by object reference is intended.")]
         public int GetHashCode(T obj)
         {
             return RuntimeHelpers.GetHashCode(obj);


mark as internal

mark as internal

--- source/Core/Configuration/Hosting/MessageCookie.cs
+++ source/Core/Configuration/Hosting/MessageCookie.cs
@@ -26,7 +26,7 @@

 namespace Thinktecture.IdentityServer.Core.Configuration.Hosting
 {
-    public class MessageCookie<TMessage>
+    internal class MessageCookie<TMessage>
         where TMessage : Message
     {
         private static readonly ILog Logger = LogProvider.GetCurrentClassLogger();


dropped wcf

dropped wcf

--- src/Dhgms.Nucleotide/Features/Wcf/WcfServiceGenerator.cs
+++ src/Dhgms.Nucleotide/Features/Wcf/WcfServiceGenerator.cs
@@ -1,53 +0,0 @@
-using System;
-using System.Threading;
-using System.Threading.Tasks;
-using CodeGeneration.Roslyn;
-using Microsoft.CodeAnalysis;
-using Microsoft.CodeAnalysis.CSharp;
-using Microsoft.CodeAnalysis.CSharp.Syntax;
-using Validation;
-
-namespace Dhgms.Nucleotide.Features.Wcf
-{
-    /// <summary>
-    /// Generates a WCF service
-    /// </summary>
-    public class WcfServiceGenerator : ICodeGenerator
-    {
-        /// <summary>
-        /// Initializes a new instance of the <see cref="WcfServiceGenerator"/> class.
-        /// </summary>
-        public WcfServiceGenerator(AttributeData attributeData)
-        {
-            Requires.NotNull(attributeData, nameof(attributeData));
-        }
-
-        /// <summary>
-        /// Create the syntax tree representing the expansion of some member to which this attribute is applied.
-        /// </summary>
-        /// <param name="context">The transformation context being generated for.</param>
-        /// <param name="progress">A way to report diagnostic messages.</param>
-        /// <param name="cancellationToken">A cancellation token.</param>
-        /// <returns>The generated member syntax to be added to the project.</returns>
-        public async Task<SyntaxList<MemberDeclarationSyntax>> GenerateAsync(
-            TransformationContext context,
-            IProgress<Diagnostic> progress,
-            CancellationToken cancellationToken)
-        {
-            var nodes = new MemberDeclarationSyntax[]
-            {
-                SyntaxFactory.NamespaceDeclaration(SyntaxFactory.IdentifierName("Wcf"))
-                    .AddMembers(GetClasses())
-            };
-
-            var results = SyntaxFactory.List(nodes);
-
-            return await Task.FromResult(results);
-        }
-
-        private MemberDeclarationSyntax[] GetClasses()
-        {
-            return new MemberDeclarationSyntax[] {};
-        }
-    }
-}


Try to fix azure service bus header cast exception. #483

--- src/DotNetCore.CAP.AzureServiceBus/AzureServiceBusConsumerClient.cs
+++ src/DotNetCore.CAP.AzureServiceBus/AzureServiceBusConsumerClient.cs
@@ -159,7 +159,7 @@

         private Task OnConsumerReceived(Message message, CancellationToken token)
         {
-            var header = message.UserProperties.ToDictionary(x => x.Key, y => y.Value.ToString());
+            var header = message.UserProperties.ToDictionary(x => x.Key, y => y.Value?.ToString());

             var context = new TransportMessage(header, message.Body);


Cleanup test

Cleanup test

--- src/EditorFeatures/Test/InheritanceMargin/InheritanceMarginTests.cs
+++ src/EditorFeatures/Test/InheritanceMargin/InheritanceMarginTests.cs
@@ -20,7 +20,7 @@
     [UseExportProvider]
     public class InheritanceMarginTests
     {
-        private const string SearchAreaTag = "SeachTag";
+        private const string SearchAreaTag = nameof(SearchAreaTag);

         #region Helpers


add ParameterOf<T>(string name = null)

add ParameterOf<T>(string name = null)

--- src/FastExpressionCompiler.LightExpression/Expression.cs
+++ src/FastExpressionCompiler.LightExpression/Expression.cs
@@ -114,6 +114,10 @@
                 return new TypedParameterExpression<object[]>(name);
             return new TypedParameterExpression(type, name);
         }
+
+        [MethodImpl((MethodImplOptions)256)]
+        public static ParameterExpression ParameterOf<T>(string name = null) =>
+            new TypedParameterExpression<T>(name);

         /// <summary>Variable is not by-ref yet</summary>
         public static ParameterExpression Variable(Type type, string name = null) =>