Update Button.Text property on Android

Update Button.Text property on Android

--- src/Droid/Renderers/BindablePickerRendererDroid.cs
+++ src/Droid/Renderers/BindablePickerRendererDroid.cs
@@ -14,7 +14,7 @@
 [assembly: ExportRenderer(typeof(BindablePicker), typeof(FreshEssentials.Droid.BindablePickerRendererDroid))]
 namespace FreshEssentials.Droid
 {
-    public class BindablePickerRendererDroid : ViewRenderer<Picker, AButton>
+    public class BindablePickerRendererDroid : ViewRenderer<BindablePicker, AButton>
     {
         AlertDialog _dialog;

@@ -36,7 +36,7 @@
             base.Dispose(disposing);
         }

-        protected override void OnElementChanged(ElementChangedEventArgs<Picker> e)
+        protected override void OnElementChanged(ElementChangedEventArgs<BindablePicker> e)
         {
             if (e.OldElement != null)
                 ((ObservableCollection<string>)e.OldElement.Items).CollectionChanged -= RowsCollectionChanged;
@@ -118,7 +118,10 @@

         void UpdatePicker()
         {
-            Control.Hint = Element.Title;
+            if (Element.SelectedIndex < 0)
+                Control.Text = Element.Title;
+            else
+                Control.Text = Element.Items[Element.SelectedIndex];
         }

         class PickerListener : Object, IOnClickListener


Woops, im blind

Woops, im blind

--- src/Plugins/TTSPlugin/TTS.cs
+++ src/Plugins/TTSPlugin/TTS.cs
@@ -44,7 +44,7 @@
                 var checksum = MD5.Create().ComputeHash(Encoding.ASCII.GetBytes(magic));
                 var stringchecksum = string.Concat(Array.ConvertAll(checksum, x => x.ToString("X2")));
                 var url =
-                    $"http://cache-a.oddcast.com/tts/gen.php?EID={engine}&LID={lang}&VID={voice}&TXT={text}&IS_UTF8=1&EXT=mp3&FNAME=&ACC={accid}&API=&SESSION=&CS={checksum}&cache_flag=3";
+                    $"http://cache-a.oddcast.com/tts/gen.php?EID={engine}&LID={lang}&VID={voice}&TXT={text}&IS_UTF8=1&EXT=mp3&FNAME=&ACC={accid}&API=&SESSION=&CS={stringchecksum}&cache_flag=3";

                 Instance.QueueForeGround.Enqueue(new Mp3MediafoundationDecoder(url));
             }


fix problem with incorrect id from scanner

the scanner was advancing to the next id on THEN tokens, but we were
assigning the value after it had advanced. I simply cached the ID number
for use later.

--- compiler/frontend/Parser.cs
+++ compiler/frontend/Parser.cs
@@ -373,13 +373,15 @@

         public Operand Identifier()
         {
+            var id = Scanner.Id;
             GetExpected(Token.IDENTIFIER);

-            return new Operand(Operand.OpType.Identifier, Scanner.Id);
+            return new Operand(Operand.OpType.Identifier, id);
         }

         public void CreateIdentifier()
         {
+            var id = Scanner.Id;
             GetExpected(Token.IDENTIFIER);
             Scanner.SymbolTble.InsertAddress(Scanner.Id, NextAddress());
         }


GetExpected calls ParserException

GetExpected calls ParserException

--- compiler/frontend/Parser.cs
+++ compiler/frontend/Parser.cs
@@ -55,9 +55,10 @@
             if (Tok == expected)
                 Next();
             else
-                Error("Error in file: " + _filename + " at line " + LineNo + ", pos " + Pos +
+                throw ParserException.CreateParserException(expected, Tok, LineNo, Pos, _filename);
+                /*Error("Error in file: " + _filename + " at line " + LineNo + ", pos " + Pos +
                       "\n\tFound: " + TokenHelper.ToString(Tok) + " but Expected: " +
-                      TokenHelper.ToString(expected));
+                      TokenHelper.ToString(expected));*/
         }

         public void Error(string str)


Test for component filtering

Test for component filtering

--- src/GeocodeSharp.Tests/Google/GeocodeClientTest.cs
+++ src/GeocodeSharp.Tests/Google/GeocodeClientTest.cs
@@ -9,6 +9,16 @@
     [TestClass]
     public class GeocodeClientTest
     {
+        [TestMethod]
+        public async Task TestComponentFilter()
+        {
+            var client = new GeocodeClient();
+            var result = await client.GeocodeAddress("santa cruz");
+            Assert.IsTrue(result.Results.Count() > 1, "'santa cruz' should return multiple results when used without component filter.");
+            result = await client.GeocodeAddress("santa cruz", null, new ComponentFilter { Country = "es" });
+            Assert.IsTrue(result.Results.Count() == 1, "'santa cruz' should return singler result when used with Country=es filter");
+        }
+
         [TestMethod]
         public async Task TestGeocodeAddressZeroResults()
         {


Add overloads to HttpRequest.Create.JsonFromUri(uri|string) that take a JsonSerializerSettings.

--- src/HTTPlease.Formatters.Json/FactoryExtensions.cs
+++ src/HTTPlease.Formatters.Json/FactoryExtensions.cs
@@ -1,4 +1,5 @@
-using System;
+using Newtonsoft.Json;
+using System;

 namespace HTTPlease.Formatters.Json
 {
@@ -24,13 +25,36 @@
 			if (requestFactory == null)
 				throw new ArgumentNullException(nameof(requestFactory));

+			return requestFactory.JsonFromUri(requestUri, null);
+		}
+
+		/// <summary>
+		///		Create a new HTTP request that expects and uses JSON as its primary format.
+		/// </summary>
+		/// <param name="requestFactory">
+		///		The HTTP request factory.
+		/// </param>
+		/// <param name="requestUri">
+		///		The request URI (can be relative or absolute).
+		/// </param>
+		/// <param name="serializerSettings">
+		///		The JSON serialiser settings used by the <see cref="JsonFormatter"/>.
+		/// </param>
+		/// <returns>
+		///		The new <see cref="HttpRequest"/>.
+		/// </returns>
+		public static HttpRequest JsonFromUri(this HttpRequestFactory requestFactory, string requestUri, JsonSerializerSettings serializerSettings)
+		{
+			if (requestFactory == null)
+				throw new ArgumentNullException(nameof(requestFactory));
+
 			if (String.IsNullOrWhiteSpace(requestUri))
 				throw new ArgumentException("Argument cannot be null, empty, or composed entirely of whitespace: 'requestUri'.", nameof(requestUri));

 			return
 				requestFactory.FromUri(requestUri)
 					.ExpectJson()
-					.UseJson();
+					.UseJson(serializerSettings);
 		}

 		/// <summary>
@@ -50,13 +74,36 @@
 			if (requestFactory == null)
 				throw new ArgumentNullException(nameof(requestFactory));

+			return requestFactory.JsonFromUri(requestUri, null);
+		}
+
+		/// <summary>
+		///		Create a new HTTP request that expects and uses JSON as its primary format.
+		/// </summary>
+		/// <param name="requestFactory">
+		///		The HTTP request factory.
+		/// </param>
+		/// <param name="requestUri">
+		///		The request URI (can be relative or absolute).
+		/// </param>
+		/// <param name="serializerSettings">
+		///		The JSON serialiser settings used by the <see cref="JsonFormatter"/>.
+		/// </param>
+		/// <returns>
+		///		The new <see cref="HttpRequest"/>.
+		/// </returns>
+		public static HttpRequest JsonFromUri(this HttpRequestFactory requestFactory, Uri requestUri, JsonSerializerSettings serializerSettings)
+		{
+			if (requestFactory == null)
+				throw new ArgumentNullException(nameof(requestFactory));
+
 			if (requestUri == null)
 				throw new ArgumentNullException(nameof(requestUri));

 			return
 				requestFactory.FromUri(requestUri)
 					.ExpectJson()
-					.UseJson();
+					.UseJson(serializerSettings);
 		}
 	}
 }


Correction "OnFuturesClientHolding"

Correction "OnFuturesClientHolding"

--- src/QuikSharp/QuikService.cs
+++ src/QuikSharp/QuikService.cs
@@ -451,8 +451,8 @@

                     case EventNames.OnFuturesClientHolding:
                         Trace.Assert(message is Message<FuturesClientHolding>);
-                        var data = ((Message<FuturesClientHolding>)message).Data;
-                        Events.OnFuturesClientHoldingCall(data);
+                        var futPos = ((Message<FuturesClientHolding>)message).Data;
+                        Events.OnFuturesClientHoldingCall(futPos);
                         break;

                     case EventNames.OnFuturesLimitChange:
@@ -487,8 +487,8 @@

                     case EventNames.OnParam:
                         Trace.Assert(message is Message<Param>);
-                        var futPos = ((Message<Param>)message).Data;
-                        Events.OnParamCall(futPos);
+                        var data = ((Message<Param>)message).Data;
+                        Events.OnParamCall(data);
                         break;

                     case EventNames.OnQuote:


Fixed compiler issue.

Fixed compiler issue.

--- src/Jobs/Exceptionless.AzureFunctions/JobRunner.cs
+++ src/Jobs/Exceptionless.AzureFunctions/JobRunner.cs
@@ -100,6 +100,7 @@
             string jobName = typeof(TWorkItem).Name;
             log.Info($"Processing {jobName} queue item: {id} Attempts: {dequeueCount} Enqueued: {insertionTime:O}");

+            var job = _serviceProvider.GetService<TJob>();
             var data = await _serializer.DeserializeAsync<TWorkItem>(message).AnyContext();
             var entry = new AzureStorageQueueEntry<TWorkItem>(new CloudQueueMessage(id, popReceipt), data, job.Queue) {
                 Attempts = dequeueCount,
@@ -110,7 +111,6 @@
             await IncrementDequeueCountersAsync(entry).AnyContext();

             log.Info($"Running job {jobName}: {id}");
-            var job = _serviceProvider.GetService<TJob>();
             var result = await job.ProcessAsync(entry, token).AnyContext();
             LogResult(result, log, jobName);
         }


Lucene.Net.Store.CompoundFileDirectory refactor: renamed private/internal fields camelCase

--- src/Lucene.Net.Core/Store/CompoundFileDirectory.cs
+++ src/Lucene.Net.Core/Store/CompoundFileDirectory.cs
@@ -434,15 +434,15 @@

         private class IndexInputSlicerAnonymousInnerClassHelper : IndexInputSlicer
         {
-            private readonly CompoundFileDirectory OuterInstance;
-
-            private Lucene.Net.Store.CompoundFileDirectory.FileEntry Entry;
+            private readonly CompoundFileDirectory outerInstance;
+
+            private Lucene.Net.Store.CompoundFileDirectory.FileEntry entry;

             public IndexInputSlicerAnonymousInnerClassHelper(CompoundFileDirectory outerInstance, Lucene.Net.Store.CompoundFileDirectory.FileEntry entry)
                 : base(outerInstance)
             {
-                this.OuterInstance = outerInstance;
-                this.Entry = entry;
+                this.outerInstance = outerInstance;
+                this.entry = entry;
             }

             public override void Dispose(bool disposing)
@@ -451,13 +451,13 @@

             public override IndexInput OpenSlice(string sliceDescription, long offset, long length)
             {
-                return OuterInstance.handle.OpenSlice(sliceDescription, Entry.Offset + offset, length);
+                return outerInstance.handle.OpenSlice(sliceDescription, entry.Offset + offset, length);
             }

             [Obsolete]
             public override IndexInput OpenFullSlice()
             {
-                return OpenSlice("full-slice", 0, Entry.Length);
+                return OpenSlice("full-slice", 0, entry.Length);
             }
         }


Fixed the mistake with ipv6 multicast address for the byebye notification

--- src/Main/RSSDP.Portable/SsdpDevicePublisherBase.cs
+++ src/Main/RSSDP.Portable/SsdpDevicePublisherBase.cs
@@ -773,7 +773,7 @@
 					foreach (var addressV6 in SsdpConstants.MulticastAdminLocalAddressV6)
 					{
 						var multicastMessageV6 = BuildByeByeMessage(notificationType, uniqueServiceName,
-							SsdpConstants.MulticastLocalAdminAddress);
+							addressV6);
 						_CommsServer.SendMessage(multicastMessageV6, new UdpEndPoint
 						{
 							IPAddress = addressV6,


update version number

update version number

--- src/NRefactoryCUBuilder/Properties/AssemblyInfo.cs
+++ src/NRefactoryCUBuilder/Properties/AssemblyInfo.cs
@@ -32,5 +32,5 @@
 // You can specify all the values or you can default the Build and Revision Numbers
 // by using the '*' as shown below:
 // [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.0.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
+[assembly: AssemblyVersion("1.1.0.0")]
+[assembly: AssemblyFileVersion("1.1.0.0")]


Fix for plugin config path being created twice

--- src/Procon.Core.Shared/Plugins/PluginController.cs
+++ src/Procon.Core.Shared/Plugins/PluginController.cs
@@ -202,9 +202,9 @@
                 this.ConfigDirectoryInfo.Create();
             }

-            if (setup.ConfigDirectoryPath != null) {
-                this.ConfigDirectoryInfo = new DirectoryInfo(setup.ConfigDirectoryPath);
-                this.ConfigDirectoryInfo.Create();
+            if (setup.LogDirectoryPath != null) {
+                this.LogDirectoryInfo = new DirectoryInfo(setup.LogDirectoryPath);
+                this.LogDirectoryInfo.Create();
             }
         }


fixed type spec formatting

fixed type spec formatting

--- xpiler/CSharpFormatter.cs
+++ xpiler/CSharpFormatter.cs
@@ -543,23 +543,19 @@
                     property.DefaultValue = "null";
                 }

-                string type = property.TypeSpec.Type;
-                if (Types.IsBuiltin(type))
-                {
-                    if (Types.IsPrimitive(type))
-                    {
-                        property.NativeType = nativeTypes[type];
-                    }
-                    else  // collection type
-                    {
-                        property.NativeType = FormatCollectionType(property.TypeSpec);
-                    }
-                }
-                else  // custom type
-                {
-                    property.NativeType = type;
-                }
-            }
+                property.NativeType = FormatTypeSpec(property.TypeSpec);
+            }
+        }
+
+        private static string FormatTypeSpec(TypeSpec typeSpec)
+        {
+            string type = typeSpec.Type;
+            if (!Types.IsBuiltin(type))
+            {
+                return type;  // custom type
+            }
+            return Types.IsPrimitive(type) ? nativeTypes[type]
+                                           : FormatCollectionType(typeSpec);
         }

         private static string FormatCollectionType(TypeSpec typeSpec)
@@ -579,7 +575,7 @@
                     {
                         sb.Append(", ");
                     }
-                    sb.Append(detail.ToString());
+                    sb.Append(FormatTypeSpec(detail));
                 }
                 sb.Append('>');
             }


Changed JsonContractErrors to a public class.

--- src/cmstar/Serialization/Json/JsonContractErrors.cs
+++ src/cmstar/Serialization/Json/JsonContractErrors.cs
@@ -25,7 +25,7 @@

 namespace cmstar.Serialization.Json
 {
-    internal static class JsonContractErrors
+    public static class JsonContractErrors
     {
         public static JsonContractException UnexpectedToken(JsonToken expected, JsonToken actual)
         {


Add support for category-specific AnalysisLevel properties

Implements category specific AnalysisLevel properties as per https://github.com/dotnet/roslyn/issues/49250#issuecomment-742901055.

Users would now be able to specify the core AnalysisLevel and override category specific AnalysisLevel for each category.

```xml
<AnalysisLevel>5-minimum</AnalysisLevel>
<AnalysisLevelSecurity>latest-all</ AnalysisLevelSecurity >
<AnalysisLevelPerformance>preview-recommended</AnalysisLevelPerformance>
<AnalysisLevelGlobalization>5-none</AnalysisLevelGlobalization>
```

1. The post-build tool now generates category-specific global configs for each supported analysis mode
2. The tool also generates category-specific `AddGlobalAnalyzerConfigForPackage` targets so that if user overrides a category-specific AnalysisLevel property

NOTE: This PR depends on feature https://github.com/dotnet/roslyn/issues/48634, which is currently in code review: https://github.com/dotnet/roslyn/pull/49834

--- src/Tools/GenerateDocumentationAndConfigFiles/Program.cs
+++ src/Tools/GenerateDocumentationAndConfigFiles/Program.cs
@@ -202,7 +202,7 @@
                 return 2;
             }

-            CreateTargetsFile(targetsFileDir, targetsFileName, analyzerPackageName);
+            CreateTargetsFile(targetsFileDir, targetsFileName, analyzerPackageName, categories.OrderBy(c => c));

             return 0;

@@ -639,28 +639,16 @@
                 }

                 // Compute descriptors by rule ID and shipped analyzer release versions and shipped data.
-                var allRulesById = new SortedList<string, DiagnosticDescriptor>();
                 var sawShippedFile = false;
                 foreach (string assembly in assemblyList)
                 {
                     var assemblyPath = GetAssemblyPath(assembly);
-                    var analyzerFileReference = new AnalyzerFileReference(assemblyPath, AnalyzerAssemblyLoader.Instance);
-                    analyzerFileReference.AnalyzerLoadFailed += AnalyzerFileReference_AnalyzerLoadFailed;
-                    var analyzers = analyzerFileReference.GetAnalyzersForAllLanguages();
-
-                    foreach (var analyzer in analyzers)
-                    {
-                        foreach (var rule in analyzer.SupportedDiagnostics)
-                        {
-                            allRulesById[rule.Id] = rule;
-                        }
-                    }
-
                     var assemblyDir = Path.GetDirectoryName(assemblyPath);
                     if (assemblyDir is null)
                     {
                         continue;
                     }
+
                     var assemblyName = Path.GetFileNameWithoutExtension(assembly);
                     var shippedFile = Path.Combine(assemblyDir, "AnalyzerReleases", assemblyName, ReleaseTrackingHelper.ShippedFileName);
                     if (File.Exists(shippedFile))
@@ -711,23 +699,49 @@

                         foreach (var analysisMode in Enum.GetValues(typeof(AnalysisMode)))
                         {
-                            CreateGlobalconfig(
-                                analyzerGlobalconfigsDir,
+                            CreateGlobalConfig(version, analysisLevelVersionString, (AnalysisMode)analysisMode!, shippedFilesData, category: null);
+                            foreach (var category in categories)
+                            {
+                                CreateGlobalConfig(version, analysisLevelVersionString, (AnalysisMode)analysisMode!, shippedFilesData, category);
+                            }
+                        }
+                    }
+                }
+
+                return true;
+
+                // Local functions.
+
+                void CreateGlobalConfig(
+                    Version version,
+                    string analysisLevelVersionString,
+                    AnalysisMode analysisMode,
+                    ImmutableArray<ReleaseTrackingData> shippedFilesData,
+                    string? category)
+                {
+                    var analysisLevelPropName = "AnalysisLevel";
+                    var title = $"Rules from '{version}' release with '{analysisMode}' analysis mode";
+                    var description = $"Rules with enabled-by-default state from '{version}' release with '{analysisMode}' analysis mode. Rules that are first released in a version later than '{version}' are disabled.";
+                    if (category != null)
+                    {
+                        analysisLevelPropName += category;
+                        title = $"'{category}' {title}";
+                        description = $"'{category}' {description}";
+                    }
+
+                    CreateGlobalconfig(
+                        analyzerGlobalconfigsDir,
 #pragma warning disable CA1308 // Normalize strings to uppercase
-                                $"AnalysisLevel_{analysisLevelVersionString}_{analysisMode!.ToString()!.ToLowerInvariant()}.editorconfig",
+                                $"{analysisLevelPropName}_{analysisLevelVersionString}_{analysisMode!.ToString()!.ToLowerInvariant()}.editorconfig",
 #pragma warning restore CA1308 // Normalize strings to uppercase
-                                $"Rules from '{version}' release with '{analysisMode}' analysis mode",
-                                $"Rules with enabled-by-default state from '{version}' release with '{analysisMode}' analysis mode. Rules that are first released in a version later than '{version}' are disabled.",
-                                (AnalysisMode)analysisMode!,
-                                allRulesById,
-                                (shippedFilesData, version));
-                        }
-                    }
-                }
-
-                return true;
-
-                // Local functions.
+                                    title,
+                        description,
+                        analysisMode,
+                        category,
+                        allRulesById,
+                        (shippedFilesData, version));
+                }
+
                 static string GetNormalizedVersionStringForEditorconfigFileNameSuffix(Version version)
                 {
                     var fieldCount = GetVersionFieldCount(version);
@@ -753,9 +767,6 @@
                         return 1;
                     }
                 }
-
-                static void AnalyzerFileReference_AnalyzerLoadFailed(object? sender, AnalyzerLoadFailureEventArgs e)
-                    => throw e.Exception ?? new InvalidOperationException(e.Message);

                 string GetAssemblyPath(string assembly)
                 {
@@ -1071,6 +1082,7 @@
             string editorconfigTitle,
             string editorconfigDescription,
             AnalysisMode analysisMode,
+            string? category,
             SortedList<string, DiagnosticDescriptor> sortedRulesById,
             (ImmutableArray<ReleaseTrackingData> shippedFiles, Version version) shippedReleaseData)
         {
@@ -1080,6 +1092,7 @@
                 editorconfigTitle,
                 editorconfigDescription,
                 analysisMode,
+                category,
                 sortedRulesById,
                 shippedReleaseData);
             var directory = Directory.CreateDirectory(folder);
@@ -1092,12 +1105,13 @@
                 string editorconfigTitle,
                 string editorconfigDescription,
                 AnalysisMode analysisMode,
+                string? category,
                 SortedList<string, DiagnosticDescriptor> sortedRulesById,
                 (ImmutableArray<ReleaseTrackingData> shippedFiles, Version version)? shippedReleaseData)
             {
                 var result = new StringBuilder();
                 StartGlobalconfig();
-                AddRules(analysisMode);
+                AddRules(analysisMode, category);
                 return result.ToString();

                 void StartGlobalconfig()
@@ -1109,16 +1123,25 @@
                     result.AppendLine();
                     result.AppendLine($@"is_global = true");
                     result.AppendLine();
-                }
-
-                bool AddRules(AnalysisMode analysisMode)
+
+                    // Append 'global_level' to ensure conflicts are properly resolved between different global configs:
+                    //   1. Lowest precedence (-2): Category-agnostic config generated by us.
+                    //   2. Higher precedence (-1): Category-specific config generated by us.
+                    //   3. Highest predence (non-negative integer): User provided config.
+                    // See https://github.com/dotnet/roslyn/issues/48634 for further details.
+                    var globalLevel = category != null ? -1 : -2;
+                    result.AppendLine($@"global_level = {globalLevel}");
+                    result.AppendLine();
+                }
+
+                bool AddRules(AnalysisMode analysisMode, string? category)
                 {
                     Debug.Assert(sortedRulesById.Count > 0);

                     var addedRule = false;
                     foreach (var rule in sortedRulesById)
                     {
-                        if (AddRule(rule.Value))
+                        if (AddRule(rule.Value, category))
                         {
                             addedRule = true;
                         }
@@ -1126,8 +1149,14 @@

                     return addedRule;

-                    bool AddRule(DiagnosticDescriptor rule)
-                    {
+                    bool AddRule(DiagnosticDescriptor rule, string? category)
+                    {
+                        if (category != null &&
+                            !string.Equals(rule.Category, category, StringComparison.OrdinalIgnoreCase))
+                        {
+                            return false;
+                        }
+
                         var (isEnabledByDefault, severity) = GetEnabledByDefaultAndSeverity(rule, analysisMode);
                         if (rule.IsEnabledByDefault == isEnabledByDefault &&
                             severity == rule.DefaultSeverity)
@@ -1246,7 +1275,7 @@
             }
         }

-        private static void CreateTargetsFile(string targetsFileDir, string targetsFileName, string packageName)
+        private static void CreateTargetsFile(string targetsFileDir, string targetsFileName, string packageName, IOrderedEnumerable<string> categories)
         {
             if (string.IsNullOrEmpty(targetsFileDir) || string.IsNullOrEmpty(targetsFileName))
             {
@@ -1254,34 +1283,73 @@
             }

             var fileContents =
-$@"<Project>{GetCommonContents(packageName)}{GetPackageSpecificContents(packageName)}
+$@"<Project>{GetCommonContents(packageName, categories)}{GetPackageSpecificContents(packageName)}
 </Project>";
             var directory = Directory.CreateDirectory(targetsFileDir);
             var fileWithPath = Path.Combine(directory.FullName, targetsFileName);
             File.WriteAllText(fileWithPath, fileContents);

-            static string GetCommonContents(string packageName)
-                => GetGlobalAnalyzerConfigTargetContents(packageName) + GetMSBuildContentForPropertyAndItemOptions() + GetCodeAnalysisTreatWarningsAsErrorsTargetContents();
-
-            static string GetGlobalAnalyzerConfigTargetContents(string packageName)
-            {
+            static string GetCommonContents(string packageName, IOrderedEnumerable<string> categories)
+            {
+                var stringBuilder = new StringBuilder();
+
+                stringBuilder.Append(GetGlobalAnalyzerConfigTargetContents(packageName, category: null));
+                foreach (var category in categories)
+                {
+                    stringBuilder.Append(GetGlobalAnalyzerConfigTargetContents(packageName, category));
+                }
+
+                stringBuilder.Append(GetMSBuildContentForPropertyAndItemOptions());
+                stringBuilder.Append(GetCodeAnalysisTreatWarningsAsErrorsTargetContents());
+                return stringBuilder.ToString();
+            }
+
+            static string GetGlobalAnalyzerConfigTargetContents(string packageName, string? category)
+            {
+                var analysisLevelPropName = "AnalysisLevel";
+                var analysisLevelPrefixPropName = "AnalysisLevelPrefix";
+                var analysisLevelSuffixPropName = "AnalysisLevelSuffix";
+                var analysisModePropName = nameof(AnalysisMode);
+                var effectiveAnalysisLevelPropName = "EffectiveAnalysisLevel";
+                var targetCondition = "'$(SkipGlobalAnalyzerConfigForPackage)' != 'true'";
+                var afterTargets = string.Empty;
                 var trimmedPackageName = packageName.Replace(".", string.Empty, StringComparison.Ordinal);
+
+                if (!string.IsNullOrEmpty(category))
+                {
+                    analysisLevelPropName += category;
+                    analysisLevelPrefixPropName += category;
+                    analysisLevelSuffixPropName += category;
+                    analysisModePropName += category;
+                    effectiveAnalysisLevelPropName += category;
+
+                    // For category-specific target, we also check if end-user has overriden category-specific AnalysisLevel or AnalysisMode.
+                    targetCondition += $" and ('$({analysisLevelPropName})' != '' or '$({analysisModePropName})' != '')";
+
+                    // Ensure that category-specific target executes after category-agnostic target
+                    afterTargets += $@"AfterTargets=""AddGlobalAnalyzerConfigForPackage_{trimmedPackageName}"" ";
+
+                    trimmedPackageName += category;
+                }
+
                 var packageVersionPropName = trimmedPackageName + "RulesVersion";
-                var propertyStringForSettingDefaultPropertyValue = GetPropertyStringForSettingDefaultPropertyValue(packageName, packageVersionPropName);
+                var propertyStringForSettingDefaultPropertyValues = GetPropertyStringForSettingDefaultPropertyValues(
+                    packageName, packageVersionPropName, category, analysisLevelPropName,
+                    analysisLevelPrefixPropName, analysisLevelSuffixPropName, effectiveAnalysisLevelPropName);

                 return $@"
-  <Target Name=""AddGlobalAnalyzerConfigForPackage_{trimmedPackageName}"" BeforeTargets=""CoreCompile"" Condition=""'$(SkipGlobalAnalyzerConfigForPackage)' != 'true'"">
+  <Target Name=""AddGlobalAnalyzerConfigForPackage_{trimmedPackageName}"" BeforeTargets=""CoreCompile"" {afterTargets}Condition=""{targetCondition}"">
     <!-- PropertyGroup to compute global analyzer config file to be used -->
-    <PropertyGroup>{propertyStringForSettingDefaultPropertyValue}
+    <PropertyGroup>{propertyStringForSettingDefaultPropertyValues}
       <!-- Set the default analysis mode, if not set by the user -->
-      <_GlobalAnalyzerConfigAnalysisMode_{trimmedPackageName}>$(AnalysisLevelSuffix)</_GlobalAnalyzerConfigAnalysisMode_{trimmedPackageName}>
-      <_GlobalAnalyzerConfigAnalysisMode_{trimmedPackageName} Condition=""'$(_GlobalAnalyzerConfigAnalysisMode_{trimmedPackageName})' == ''"">$(AnalysisMode)</_GlobalAnalyzerConfigAnalysisMode_{trimmedPackageName}>
+      <_GlobalAnalyzerConfigAnalysisMode_{trimmedPackageName}>$({analysisLevelSuffixPropName})</_GlobalAnalyzerConfigAnalysisMode_{trimmedPackageName}>
+      <_GlobalAnalyzerConfigAnalysisMode_{trimmedPackageName} Condition=""'$(_GlobalAnalyzerConfigAnalysisMode_{trimmedPackageName})' == ''"">$({analysisModePropName})</_GlobalAnalyzerConfigAnalysisMode_{trimmedPackageName}>
       <_GlobalAnalyzerConfigAnalysisMode_{trimmedPackageName} Condition=""'$(_GlobalAnalyzerConfigAnalysisMode_{trimmedPackageName})' == 'AllEnabledByDefault'"">{nameof(AnalysisMode.All)}</_GlobalAnalyzerConfigAnalysisMode_{trimmedPackageName}>
       <_GlobalAnalyzerConfigAnalysisMode_{trimmedPackageName} Condition=""'$(_GlobalAnalyzerConfigAnalysisMode_{trimmedPackageName})' == 'AllDisabledByDefault'"">{nameof(AnalysisMode.None)}</_GlobalAnalyzerConfigAnalysisMode_{trimmedPackageName}>
       <_GlobalAnalyzerConfigAnalysisMode_{trimmedPackageName} Condition=""'$(_GlobalAnalyzerConfigAnalysisMode_{trimmedPackageName})' == ''"">{nameof(AnalysisMode.Default)}</_GlobalAnalyzerConfigAnalysisMode_{trimmedPackageName}>

       <!-- GlobalAnalyzerConfig file name based on user specified package version '{packageVersionPropName}', if any. We replace '.' with '_' to map the version string to file name suffix. -->
-      <_GlobalAnalyzerConfigFileName_{trimmedPackageName} Condition=""'$({packageVersionPropName})' != ''"">AnalysisLevel_$({packageVersionPropName}.Replace(""."",""_""))_$(_GlobalAnalyzerConfigAnalysisMode_{trimmedPackageName}).editorconfig</_GlobalAnalyzerConfigFileName_{trimmedPackageName}>
+      <_GlobalAnalyzerConfigFileName_{trimmedPackageName} Condition=""'$({packageVersionPropName})' != ''"">{analysisLevelPropName}_$({packageVersionPropName}.Replace(""."",""_""))_$(_GlobalAnalyzerConfigAnalysisMode_{trimmedPackageName}).editorconfig</_GlobalAnalyzerConfigFileName_{trimmedPackageName}>

       <_GlobalAnalyzerConfigDir_{trimmedPackageName} Condition=""'$(_GlobalAnalyzerConfigDir_{trimmedPackageName})' == ''"">$(MSBuildThisFileDirectory)config</_GlobalAnalyzerConfigDir_{trimmedPackageName}>
       <_GlobalAnalyzerConfigFile_{trimmedPackageName} Condition=""'$(_GlobalAnalyzerConfigFileName_{trimmedPackageName})' != ''"">$(_GlobalAnalyzerConfigDir_{trimmedPackageName})\$(_GlobalAnalyzerConfigFileName_{trimmedPackageName})</_GlobalAnalyzerConfigFile_{trimmedPackageName}>
@@ -1293,14 +1361,60 @@
   </Target>
 ";

-                static string GetPropertyStringForSettingDefaultPropertyValue(string packageName, string packageVersionPropName)
+                static string GetPropertyStringForSettingDefaultPropertyValues(
+                    string packageName,
+                    string packageVersionPropName,
+                    string? category,
+                    string analysisLevelPropName,
+                    string analysisLevelPrefixPropName,
+                    string analysisLevelSuffixPropName,
+                    string effectiveAnalysisLevelPropName)
                 {
                     if (packageName == NetAnalyzersPackageName)
                     {
-                        return $@"
-      <!-- Default '{packageVersionPropName}' to 'EffectiveAnalysisLevel' with trimmed trailing '.0' -->
-      <{packageVersionPropName} Condition=""'$({packageVersionPropName})' == '' and $(EffectiveAnalysisLevel) != ''"">$([System.Text.RegularExpressions.Regex]::Replace($(EffectiveAnalysisLevel), '(.0)*$', ''))</{packageVersionPropName}>
+                        var propertyStr = string.Empty;
+
+                        if (!string.IsNullOrEmpty(category))
+                        {
+                            // For category-specific logic, we need to duplicate logic from SDK targets to set
+                            // category-specific AnalysisLevel property values. In future, we should consider removing similar logic from
+                            // SDK targets for core AnalysisLevel and instead generalize this logic.
+
+                            propertyStr += $@"
+      <!-- Default '{analysisLevelPropName}' to the core 'AnalysisLevel' and compute '{analysisLevelPrefixPropName}', '{analysisLevelSuffixPropName}' and '{effectiveAnalysisLevelPropName}' -->
+      <{analysisLevelPropName} Condition=""$({analysisLevelPropName}) == ''"">$(AnalysisLevel)</{analysisLevelPropName}>
+
+      <!-- {analysisLevelPropName} can also contain compound values with a prefix and suffix separated by a '-' character.
+           The prefix indicates the core AnalysisLevel for '{category}' rules and the suffix indicates the bucket of
+           rules to enable for '{category}' rules by default. For example, some valid compound values for {analysisLevelPropName} are:
+             1. '5-all' - Indicates core {analysisLevelPropName} = '5' with 'all' the '{category}' rules enabled by default.
+             2. 'latest-none' - Indicates core {analysisLevelPropName} = 'latest' with 'none' of the '{category}' rules enabled by default.
+           {analysisLevelPrefixPropName} is used to set the {effectiveAnalysisLevelPropName} below.
+           {analysisLevelSuffixPropName} is used to map to the correct global config.
+      -->
+      <{analysisLevelPrefixPropName} Condition=""$({analysisLevelPropName}.Contains('-'))"">$([System.Text.RegularExpressions.Regex]::Replace($({analysisLevelPropName}), '-(.)*', ''))</{analysisLevelPrefixPropName}>
+      <{analysisLevelSuffixPropName} Condition=""'$({analysisLevelPrefixPropName})' != ''"">$([System.Text.RegularExpressions.Regex]::Replace($({analysisLevelPropName}), '$({analysisLevelPrefixPropName})-', ''))</{analysisLevelSuffixPropName}>
+
+      <!-- {effectiveAnalysisLevelPropName} is used to differentiate from user specified strings (such as 'none')
+           and an implied numerical option (such as '4') -->
+      <!-- TODO: Remove hard-coded constants such as 4.0, 5.0 and 6.0 used below once these are exposed as properties from the SDK -->
+      <{effectiveAnalysisLevelPropName} Condition=""'$({analysisLevelPropName})' == 'none' or '$({analysisLevelPrefixPropName})' == 'none'"">4.0</{effectiveAnalysisLevelPropName}>
+      <{effectiveAnalysisLevelPropName} Condition=""'$({analysisLevelPropName})' == 'latest' or '$({analysisLevelPrefixPropName})' == 'latest'"">5.0</{effectiveAnalysisLevelPropName}>
+      <{effectiveAnalysisLevelPropName} Condition=""'$({analysisLevelPropName})' == 'preview' or '$({analysisLevelPrefixPropName})' == 'preview'"">6.0</{effectiveAnalysisLevelPropName}>
+
+      <!-- Set {effectiveAnalysisLevelPropName} to the value of {analysisLevelPropName} if it is a version number -->
+      <{effectiveAnalysisLevelPropName} Condition=""'$({effectiveAnalysisLevelPropName})' == '' And
+                                         '$({analysisLevelPrefixPropName})' != ''"">$({analysisLevelPrefixPropName})</{effectiveAnalysisLevelPropName}>
+      <{effectiveAnalysisLevelPropName} Condition=""'$({effectiveAnalysisLevelPropName})' == '' And
+                                         '$({analysisLevelPropName})' != ''"">$({analysisLevelPropName})</{effectiveAnalysisLevelPropName}>
 ";
+                        }
+
+                        propertyStr += $@"
+      <!-- Default '{packageVersionPropName}' to '{effectiveAnalysisLevelPropName}' with trimmed trailing '.0' -->
+      <{packageVersionPropName} Condition=""'$({packageVersionPropName})' == '' and $({effectiveAnalysisLevelPropName}) != ''"">$([System.Text.RegularExpressions.Regex]::Replace($({effectiveAnalysisLevelPropName}), '(.0)*$', ''))</{packageVersionPropName}>
+";
+                        return propertyStr;
                     }

                     return string.Empty;


ensure globalconfig files are lowercase

ensure globalconfig files are lowercase

--- src/Tools/GenerateDocumentationAndConfigFiles/Program.cs
+++ src/Tools/GenerateDocumentationAndConfigFiles/Program.cs
@@ -1144,7 +1144,7 @@
                 sortedRulesById,
                 shippedReleaseData);
             var directory = Directory.CreateDirectory(folder);
-            var editorconfigFilePath = Path.Combine(directory.FullName, editorconfigFileName);
+            var editorconfigFilePath = Path.Combine(directory.FullName, editorconfigFileName.ToLowerInvariant());
             File.WriteAllText(editorconfigFilePath, text);
             return;


fixes tests

fixes tests

--- src/Umbraco.Web/Editors/UserEditorAuthorizationHelper.cs
+++ src/Umbraco.Web/Editors/UserEditorAuthorizationHelper.cs
@@ -52,8 +52,16 @@
             //a user can remove any start nodes and add start nodes that they have access to
             //but they cannot add a start node that they do not have access to

-            var changedStartContentIds = savingUser == null ? startContentIds : startContentIds.Except(savingUser.StartContentIds).ToArray();
-            var changedStartMediaIds = savingUser == null ? startMediaIds : startMediaIds.Except(savingUser.StartMediaIds).ToArray();
+            var changedStartContentIds = savingUser == null
+                ? startContentIds
+                : startContentIds == null
+                    ? null
+                    : startContentIds.Except(savingUser.StartContentIds).ToArray();
+            var changedStartMediaIds = savingUser == null
+                ? startMediaIds
+                : startMediaIds == null
+                    ? null
+                    : startMediaIds.Except(savingUser.StartMediaIds).ToArray();
             var pathResult = AuthorizePath(currentUser, changedStartContentIds, changedStartMediaIds);
             if (pathResult == false)
                 return pathResult;


Simplify

Simplify

--- src/Workspaces/Remote/ServiceHub/Host/RemoteWorkspace.cs
+++ src/Workspaces/Remote/ServiceHub/Host/RemoteWorkspace.cs
@@ -391,21 +391,8 @@

                     // We're the first call that is asking about this checksum.  Create a lazy to compute it with a
                     // refcount of 1 (for 'us').
-                    refCountedLazySolution = new LazyRefCountedSolution(
-                        _gate,
-                        getSolutionAsync,
-                        cleanup: () =>
-                        {
-                            // We must already be holding the lock when cleanup is called.
-                            Contract.ThrowIfFalse(_gate.CurrentCount == 0);
-
-                            // Only remove a value from the map if it still exists and holds the same expected instance
-                            if (_solutionChecksumToLazySolution.TryGetValue(solutionChecksum, out var remainingRefCountedLazySolution)
-                                && remainingRefCountedLazySolution == refCountedLazySolution)
-                            {
-                                _solutionChecksumToLazySolution.Remove(solutionChecksum);
-                            }
-                        });
+                    refCountedLazySolution = new LazyRefCountedSolution(this, solutionChecksum, getSolutionAsync);
+                    Contract.ThrowIfFalse(refCountedLazySolution.RefCount == 1);
                     _solutionChecksumToLazySolution.Add(solutionChecksum, refCountedLazySolution);
                     return refCountedLazySolution;
                 }
@@ -432,72 +419,57 @@

                 solutionToDispose?.Dispose();
             }
-        }
-
-#pragma warning disable CA1200 // Avoid using cref tags with a prefix
-        /// <summary>
-        /// This type behaves similar to <see cref="T:Roslyn.Utilities.AsyncLazy{T}"/> (with <c>T</c> being <see
-        /// cref="Solution"/>), except for the following unique characteristics:
-        ///
-        /// <list type="bullet">
-        /// <item><description>This type will start the asynchronous computation in the constructor instead of waiting
-        /// for the first call to <see cref="M:Roslyn.Utilities.AsyncLazy{T}.GetValueAsync(CancellationToken)"/>.</description></item>
-        /// <item><description>This type can be disposed asynchronously to cancel the inner operation and wait for the
-        /// inner operation to complete cancellation processing (similar to <see
-        /// cref="TaskContinuationOptions.LazyCancellation"/>). Since <see cref="T:Roslyn.Utilities.AsyncLazy{T}"/> does
-        /// not directly expose the inner computation, it does not support lazy cancellation
-        /// scenarios.</description></item>
-        /// </list>
-        /// </summary>
-        private sealed class LazyRefCountedSolution : IDisposable
-        {
-            /// <summary>
-            /// Pointer to <see cref="RemoteWorkspace._gate"/>.
-            /// </summary>
-            private readonly SemaphoreSlim _gate;
-
-            private readonly CancellationTokenSource _cancellationTokenSource = new();
-            private readonly Action _cleanup;
-            private readonly Task<Solution> _task;
-
-            private int _refCount;
-
-            // For assertion purposes.
-            public int RefCount => _refCount;
-
-            public LazyRefCountedSolution(SemaphoreSlim gate, Func<CancellationToken, Task<Solution>> getSolutionAsync, Action cleanup)
-            {
-                _gate = gate;
-                _cleanup = cleanup;
-                _task = getSolutionAsync(_cancellationTokenSource.Token);
-                _refCount = 1;
-            }
-
-            public Task<Solution> Task => _task;
-
-            public void AddReference()
-            {
-                // We must be holding this gate when called.
-                Contract.ThrowIfFalse(_gate.CurrentCount == 0);
-                Contract.ThrowIfTrue(_refCount == 0);
-                _refCount++;
-            }
-
-            public void Dispose()
-            {
-                // We must be holding this gate when called.
-                Contract.ThrowIfFalse(_gate.CurrentCount == 0);
-                Contract.ThrowIfTrue(_refCount == 0);
-                _refCount--;
-                if (_refCount == 0)
-                {
-                    _cancellationTokenSource.Cancel();
-                    _cancellationTokenSource.Dispose();
-
-                    _cleanup();
-                }
-            }
-        }
-#pragma warning restore CA1200 // Avoid using cref tags with a prefix
+
+            public sealed class LazyRefCountedSolution : IDisposable
+            {
+                private readonly ChecksumToSolutionCache _cache;
+                private readonly Checksum _solutionChecksum;
+                private readonly CancellationTokenSource _cancellationTokenSource = new();
+                private readonly Task<Solution> _task;
+
+                private int _refCount = 1;
+
+                // For assertion purposes.
+                public int RefCount => _refCount;
+
+                public LazyRefCountedSolution(
+                    ChecksumToSolutionCache cache,
+                    Checksum solutionChecksum,
+                    Func<CancellationToken, Task<Solution>> getSolutionAsync)
+                {
+                    _cache = cache;
+                    _solutionChecksum = solutionChecksum;
+                    _task = getSolutionAsync(_cancellationTokenSource.Token);
+                }
+
+                public Task<Solution> Task => _task;
+
+                public void AddReference()
+                {
+                    // We must be holding this gate when called.
+                    Contract.ThrowIfFalse(_cache._gate.CurrentCount == 0);
+                    Contract.ThrowIfTrue(_refCount == 0);
+                    _refCount++;
+                }
+
+                public void Dispose()
+                {
+                    using (_cache._gate.DisposableWait())
+                    {
+                        Contract.ThrowIfTrue(_refCount == 0);
+                        _refCount--;
+                        if (_refCount == 0)
+                        {
+                            _cancellationTokenSource.Cancel();
+                            _cancellationTokenSource.Dispose();
+
+                            Contract.ThrowIfFalse(_cache._solutionChecksumToLazySolution.TryGetValue(_solutionChecksum, out var existingSolution));
+                            Contract.ThrowIfFalse(existingSolution == this);
+                            _cache._solutionChecksumToLazySolution.Remove(_solutionChecksum);
+                        }
+                    }
+                }
+            }
+        }
     }
 }


Add comment

Add comment

--- src/Workspaces/Remote/ServiceHub/Host/RemoteWorkspace.cs
+++ src/Workspaces/Remote/ServiceHub/Host/RemoteWorkspace.cs
@@ -109,6 +109,11 @@
         /// solution returned is only for legacy cases where we expose OOP to 2nd party clients who expect to be able to
         /// call through <see cref="RemoteWorkspaceManager.GetSolutionAsync"/> and who expose that statically to
         /// themselves.
+        /// <para>
+        /// During the life of the call to <paramref name="doWorkAsync"/> the solution corresponding to <paramref
+        /// name="solutionChecksum"/> will be kept alive and returned to any other concurrent calls to this method with
+        /// the same <paramref name="solutionChecksum"/>.
+        /// </para>
         /// </summary>
         public async ValueTask<(Solution solution, T result)> RunWithSolutionAsync<T>(
             AssetProvider assetProvider,


Carry over the inner exception when an error occurred in an isolated task (issue 751)

--- src/Gallio/Gallio/Model/Isolation/IsolatedTask.cs
+++ src/Gallio/Gallio/Model/Isolation/IsolatedTask.cs
@@ -45,7 +45,7 @@
             }
             catch (Exception ex)
             {
-                throw new ModelException(ex.ToString());
+                throw new ModelException(ex.ToString(), ex);
             }
         }


Use HTML for item title. Fixes #10.

Use HTML for item title. Fixes #10.

--- src/GitHubFeeds/Controllers/CommentsController.cs
+++ src/GitHubFeeds/Controllers/CommentsController.cs
@@ -257,13 +257,19 @@
 			string title = p.Version == 1 ? "{0} commented on {1}/{2}".FormatWith(model.Commenter, p.User, p.Repo) :
 				"{0}’s commit: {1}".FormatWith(model.Author, RenderCommitForSubject(model));

-			return new SyndicationItem(title,
-				new TextSyndicationContent(CreateCommentHtml(p.Version, model), TextSyndicationContentKind.Html),
-				comment.html_url, comment.url.AbsoluteUri, comment.updated_at)
+			return new SyndicationItem
 			{
 				Authors = { new SyndicationPerson(null, comment.user.login, null) },
-				Links  = { new SyndicationLink(new Uri(model.CommitUrl)) { RelationshipType = "related", Title = "CommitUrl" } },
+				Content = new TextSyndicationContent(CreateCommentHtml(p.Version, model), TextSyndicationContentKind.Html),
+				Id = comment.url.AbsoluteUri,
+				LastUpdatedTime = comment.updated_at,
+				Links =
+					{
+						SyndicationLink.CreateAlternateLink(comment.html_url),
+						new SyndicationLink(new Uri(model.CommitUrl)) { RelationshipType = "related", Title = "CommitUrl" }
+					},
 				PublishDate = comment.created_at,
+				Title = new TextSyndicationContent(HttpUtility.HtmlEncode(title), TextSyndicationContentKind.Html),
 			};
 		}


Random IV, do not use the passphrase

Random IV, do not use the passphrase

--- src/Logikfabrik.Overseer/Settings/XmlEncrypter.cs
+++ src/Logikfabrik.Overseer/Settings/XmlEncrypter.cs
@@ -193,17 +193,15 @@
         private static Rijndael GetAlgorithm(byte[] passphraseHash)
         {
             var key = new byte[16];
-            var iv = new byte[16];

             Array.Copy(passphraseHash, 0, key, 0, 16);
-            Array.Copy(passphraseHash, 0, iv, 0, 16); // TODO: Generate/save/load IV seperate from passphrase (key).

             var algorithm = Rijndael.Create();

             algorithm.KeySize = 128;
             algorithm.BlockSize = 128;
             algorithm.Key = key;
-            algorithm.IV = iv;
+            algorithm.IV = HashUtility.GetSalt(16);

             return algorithm;
         }


Fix typo in IDX10638 log message.

Fix typo in IDX10638 log message.

--- src/Microsoft.IdentityModel.Tokens/LogMessages.cs
+++ src/Microsoft.IdentityModel.Tokens/LogMessages.cs
@@ -118,7 +118,7 @@
         public const string IDX10634 = "IDX10634: Unable to create the SignatureProvider.\nAlgorithm: '{0}', SecurityKey: '{1}'\n is not supported.";
         public const string IDX10635 = "IDX10635: Unable to create signature. '{0}' returned a null '{1}'. SecurityKey: '{2}', Algorithm: '{3}'";
         public const string IDX10636 = "IDX10636: CryptoProviderFactory.CreateForVerifying returned null for key: '{0}', signatureAlgorithm: '{1}'.";
-        public const string IDX10638 = "IDX10638: Cannot created the SignatureProvider, 'key.HasPrivateKey' is false, cannot create signatures. Key: {0}.";
+        public const string IDX10638 = "IDX10638: Cannot create the SignatureProvider, 'key.HasPrivateKey' is false, cannot create signatures. Key: {0}.";
         public const string IDX10640 = "IDX10640: Algorithm is not supported: '{0}'.";
         public const string IDX10641 = "IDX10641: Key is not supported: '{0}'.";
         public const string IDX10642 = "IDX10642: Creating signature using the input: '{0}'.";


Update DisposableObjectPool to dispose on Free() when full

When the internal `items` array of DisposableObjectPool is full, calls to Free() (that are trying to return over-allocated instances during a spike in calls to Allocate() "drop" the object by doing nothing.

Since the object is not disposed, before it can be garbage collected it has to wait in the finalization queue for finalization to call dispose.

This change updates Free() to directly dispose those objects which can't be returned to the pool, allowing them to avoid a potentially long wait in the finalizer queue.

--- src/Microsoft.IdentityModel.Tokens/ObjectPools.cs
+++ src/Microsoft.IdentityModel.Tokens/ObjectPools.cs
@@ -126,16 +126,26 @@
         internal void Free(T obj)
         {
             var items = Items;
+            bool returned = false;
             for (int i = 0; i < items.Length; i++)
             {
                 if (items[i].Value == null)
                 {
-                    // Intentionally not using interlocked here.
-                    // In a worst case scenario two objects may be stored into same slot.
-                    // It is very unlikely to happen and will only mean that one of the objects will get collected.
-                    items[i].Value = obj;
-                    break;
+                    // We need to know if we returned the object. If we didn't, it needs to get disposed.
+                    if (null == Interlocked.CompareExchange(ref items[i].Value, obj, null))
+                    {
+                        returned = true;
+                        break;
+                    }
                 }
+            }
+
+            // Our pool is full, we can't hold on to this object, so it will get dropped / garbage collected.
+            // However this object was disposable, so we should dispose it now, else the disposal work
+            // would have to be done by the finalizer, which may impact high performance scenarios (since the finalizer queue is worked on sequentially.)
+            if (!returned)
+            {
+                obj.Dispose();
             }
         }
     }


Reeenable VisualBasic test on ILC. (#22121) (#22342)

The underlying codegen bug has been fixed and is now
in the main Project N branch.

--- src/Microsoft.VisualBasic/tests/OperatorsTests.cs
+++ src/Microsoft.VisualBasic/tests/OperatorsTests.cs
@@ -112,6 +112,7 @@
             yield return new object[] { (ulong)12, "2", (double)14 };
             yield return new object[] { (ulong)13, true, (decimal)12 };
             yield return new object[] { (ulong)14, null, (ulong)14 };
+            yield return new object[] { (ulong)15, ulong.MaxValue, decimal.Parse("18446744073709551630") };

             // long + primitives.
             yield return new object[] { (long)8, (long)2, (long)10 };
@@ -121,6 +122,7 @@
             yield return new object[] { (long)12, "2", (double)14 };
             yield return new object[] { (long)13, true, (long)12 };
             yield return new object[] { (long)14, null, (long)14 };
+            yield return new object[] { (long)15, long.MaxValue, decimal.Parse("9223372036854775822") };

             // float + primitives
             yield return new object[] { (float)9, (float)2, (float)11 };
@@ -182,14 +184,6 @@
         }

         [Fact]
-        [ActiveIssue("https://github.com/dotnet/corefx/issues/21682 -- fails when /buildtype:ret passed to ILC", TargetFrameworkMonikers.UapAot)]
-        public void AddObject_Convertible_ReturnsExpected_64BitOverflow()
-        {
-            AddObject_Convertible_ReturnsExpected((ulong)15, ulong.MaxValue, decimal.Parse("18446744073709551630"));
-            AddObject_Convertible_ReturnsExpected((long)15, long.MaxValue, decimal.Parse("9223372036854775822"));
-        }
-
-        [Fact]
         public void AddObject_DateString_ReturnsExpected()
         {
             string expected = Assert.IsType<string>(Operators.AddObject("String", new DateTime(2017, 10, 10)));


Fill as much of m_buffer as possible when a MySQL packet crosses the buffer boundary.

--- src/MySql.Data/Serialization/PacketTransmitter.cs
+++ src/MySql.Data/Serialization/PacketTransmitter.cs
@@ -139,15 +139,18 @@
 			// allocate a larger buffer if necessary
 			var readData = m_buffer;
 			if (payloadLength > m_buffer.Length)
+			{
 				readData = new byte[payloadLength];
+				m_socketAwaitable.EventArgs.SetBuffer(readData, 0, 0);
+			}
 			Buffer.BlockCopy(m_buffer, m_offset, readData, 0, m_end - m_offset);
-			m_socketAwaitable.EventArgs.SetBuffer(readData, 0, 0);
+			m_end -= m_offset;
+			m_offset = 0;

 			// read payload
-			offset = m_end - m_offset;
-			count = payloadLength - offset;
-			m_offset = m_end;
-			while (count > 0)
+			offset = m_end;
+			count = readData.Length - m_end;
+			while (m_end < payloadLength)
 			{
 				m_socketAwaitable.EventArgs.SetBuffer(offset, count);
 				await m_socket.ReceiveAsync(m_socketAwaitable);
@@ -155,12 +158,16 @@
 				if (bytesRead <= 0)
 					throw new EndOfStreamException();
 				offset += bytesRead;
+				m_end += bytesRead;
 				count -= bytesRead;
 			}

 			// switch back to original buffer if a larger one was allocated
 			if (payloadLength > m_buffer.Length)
+			{
 				m_socketAwaitable.EventArgs.SetBuffer(m_buffer, 0, 0);
+				m_end = 0;
+			}

 			// check for error
 			if (readData[0] == 0xFF)
@@ -170,6 +177,9 @@
 				var message = Encoding.UTF8.GetString(readData, 9, payloadLength - 9);
 				throw new MySqlException(errorCode, sqlState, message);
 			}
+
+			if (payloadLength <= m_buffer.Length)
+				m_offset = payloadLength;

 			return new PayloadData(new ArraySegment<byte>(readData, 0, payloadLength));
 		}


Allow any attribute called JsonExtensionDataAttribute (#1261)

--- src/NJsonSchema/Generation/JsonSchemaGenerator.cs
+++ src/NJsonSchema/Generation/JsonSchemaGenerator.cs
@@ -752,7 +752,7 @@
             where TSchemaType : JsonSchema, new()
         {
             var extensionDataProperty = type.GetContextualProperties()
-                .FirstOrDefault(p => p.GetContextAttribute<JsonExtensionDataAttribute>() != null);
+                .FirstOrDefault(p => p.ContextAttributes.Any(a => a.GetType().Name == "JsonExtensionDataAttribute"));

             if (extensionDataProperty != null)
             {


Remove unused using in ITestRunnerFactory

--- Moya/Factories/ITestRunnerFactory.cs
+++ Moya/Factories/ITestRunnerFactory.cs
@@ -1,6 +1,5 @@
 namespace Moya.Factories
 {
-    using Attributes;
     using Runners;
     using System;


Prepend Try Prefix to method with out parameter

This makes the naming of the method consistent with design patterns (and
other methods in the same library)

--- src/SimpleJson/SimpleJson.cs
+++ src/SimpleJson/SimpleJson.cs
@@ -1012,7 +1012,7 @@
                         else
                         {
                             object serializedObject;
-                            success = jsonSerializerStrategy.SerializeNonPrimitiveObject(value, out serializedObject);
+                            success = jsonSerializerStrategy.TrySerializeNonPrimitiveObject(value, out serializedObject);
                             if (success)
                                 SerializeValue(jsonSerializerStrategy, serializedObject, builder);
                         }
@@ -1184,7 +1184,7 @@
  interface IJsonSerializerStrategy
     {
         [SuppressMessage("Microsoft.Design", "CA1007:UseGenericsWhereAppropriate", Justification="Need to support .NET 2")]
-        bool SerializeNonPrimitiveObject(object input, out object output);
+        bool TrySerializeNonPrimitiveObject(object input, out object output);
         object DeserializeObject(object value, Type type);
     }

@@ -1265,7 +1265,7 @@
             return result;
         }

-        public virtual bool SerializeNonPrimitiveObject(object input, out object output)
+        public virtual bool TrySerializeNonPrimitiveObject(object input, out object output)
         {
             return TrySerializeKnownTypes(input, out output) || TrySerializeUnknownTypes(input, out output);
         }


do not do futility cutoff if move will cause check.

--- NoraGrace/NoraGrace.Engine/Search.cs
+++ NoraGrace/NoraGrace.Engine/Search.cs
@@ -725,7 +725,7 @@
 			int blunders = 0;
             Move bestmove = Move.EMPTY;

-
+            CheckInfo checkInfo = CheckInfo.Generate(board, board.WhosTurn.PlayerOther());

             ChessMoveData moveData;
             while ((moveData = plyMoves.NextMoveData()).Move != Move.EMPTY)
@@ -733,6 +733,8 @@
                 Move move = moveData.Move;

 				CurrentVariation[ply] = move;
+
+                bool move_will_give_check = MoveInfo.CausesCheck(move, board, ref checkInfo);

                 var moveGain = _moveBuffer.History.ReadMaxPositionalGain(board.PieceAt(move.From()), move.To());

@@ -741,6 +743,7 @@
                     && moveData.Flags == 0
                     && depth.ToPly() <= 3
                     && !in_check_before_move
+                    && !move_will_give_check
                     && legalMovesTried > 3)
                 {
                     if (init_score + moveGain + MarginFutilityPre(depth.SubstractPly(1)) < alpha)
@@ -766,6 +769,7 @@
                 //decide if we want to extend or maybe reduce this node
                 SearchDepth ext = 0;
                 bool isCheck = board.IsCheck(board.WhosTurn);
+
                 if (isCheck) { ext = this.SearchArgs.ExtensionCheck; }

                 Position moveFrom = move.From();


Added method on Get-NtSid to build from an authority and rids.

--- NtObjectManager/NtSecurityCmdlets.cs
+++ NtObjectManager/NtSecurityCmdlets.cs
@@ -180,6 +180,18 @@
         /// </summary>
         [Parameter(ParameterSetName = "cap")]
         public SwitchParameter CapabilityGroup { get; set; }
+
+        /// <summary>
+        /// <para type="description">Specify a SIDs security authority.</para>
+        /// </summary>
+        [Parameter(Mandatory = true, ParameterSetName = "sid")]
+        public SecurityAuthority SecurityAuthority { get; set; }
+
+        /// <summary>
+        /// <para type="description">Specify the relative identifiers.</para>
+        /// </summary>
+        [Parameter(Mandatory = true, ParameterSetName = "sid")]
+        public uint[] RelativeIdentifiers { get; set; }

         /// <summary>
         /// Process record.
@@ -251,8 +263,12 @@
             }
             else if (CapabilityName != null)
             {
-                sid = CapabilityGroup ? NtSecurity.GetCapabilityGroupSid(CapabilityName)
+                sid = CapabilityGroup ? NtSecurity.GetCapabilityGroupSid(CapabilityName)
                     : NtSecurity.GetCapabilitySid(CapabilityName);
+            }
+            else if (RelativeIdentifiers != null)
+            {
+                sid = new Sid(SecurityAuthority, RelativeIdentifiers);
             }
             else
             {


add tags to details

add tags to details

--- NuGet.Extensions/Commands/Details.cs
+++ NuGet.Extensions/Commands/Details.cs
@@ -77,6 +77,7 @@
             Console.WriteLine("Package ID:".PadRight(_indent) + string.Format("{0}", package.Id));
             Console.WriteLine("Package Version:".PadRight(_indent) + string.Format("{0}", package.Version));
             Console.WriteLine("Package Description:".PadRight(_indent) + string.Format("{0}", package.Description));
+            if (!string.IsNullOrEmpty(package.Tags)) Console.WriteLine("Package Tags:".PadRight(_indent - 1) + string.Format("{0}", package.Tags));
             if (!NoAuthors) OutputAuthors(package);
             if (!NoFiles) OutputContent(package);
             if (!NoDependencies) OutputDependencies(package);


[C#] add SetHashOf(byte[])

[C#] add SetHashOf(byte[])

--- ffi/cs/mcl/mcl.cs
+++ ffi/cs/mcl/mcl.cs
@@ -28,7 +28,7 @@
         [DllImport(dllName)] public static extern int mclBnFr_isOne(in Fr x);
         [DllImport(dllName)] public static extern void mclBnFr_setByCSPRNG(ref Fr x);

-        [DllImport(dllName)] public static extern int mclBnFr_setHashOf(ref Fr x, [In][MarshalAs(UnmanagedType.LPStr)] string buf, long bufSize);
+        [DllImport(dllName)] public static extern int mclBnFr_setHashOf(ref Fr x, [In]byte[] buf, long bufSize);
         [DllImport(dllName)] public static extern int mclBnFr_getStr([Out] StringBuilder buf, long maxBufSize, in Fr x, int ioMode);

         [DllImport(dllName)] public static extern void mclBnFr_neg(ref Fr y, in Fr x);
@@ -48,7 +48,7 @@
         [DllImport(dllName)] public static extern int mclBnFp_isOne(in Fp x);
         [DllImport(dllName)] public static extern void mclBnFp_setByCSPRNG(ref Fp x);

-        [DllImport(dllName)] public static extern int mclBnFp_setHashOf(ref Fp x, [In][MarshalAs(UnmanagedType.LPStr)] string buf, long bufSize);
+        [DllImport(dllName)] public static extern int mclBnFp_setHashOf(ref Fp x, [In]byte[] buf, long bufSize);
         [DllImport(dllName)] public static extern int mclBnFp_getStr([Out] StringBuilder buf, long maxBufSize, in Fp x, int ioMode);

         [DllImport(dllName)] public static extern void mclBnFp_neg(ref Fp y, in Fp x);
@@ -64,7 +64,7 @@
         [DllImport(dllName)] public static extern int mclBnG1_isValid(in G1 x);
         [DllImport(dllName)] public static extern int mclBnG1_isEqual(in G1 x, in G1 y);
         [DllImport(dllName)] public static extern int mclBnG1_isZero(in G1 x);
-        [DllImport(dllName)] public static extern int mclBnG1_hashAndMapTo(ref G1 x, [In][MarshalAs(UnmanagedType.LPStr)] string buf, long bufSize);
+        [DllImport(dllName)] public static extern int mclBnG1_hashAndMapTo(ref G1 x, [In]byte[] buf, long bufSize);
         [DllImport(dllName)] public static extern long mclBnG1_getStr([Out] StringBuilder buf, long maxBufSize, in G1 x, int ioMode);
         [DllImport(dllName)] public static extern void mclBnG1_neg(ref G1 y, in G1 x);
         [DllImport(dllName)] public static extern void mclBnG1_dbl(ref G1 y, in G1 x);
@@ -79,7 +79,7 @@
         [DllImport(dllName)] public static extern int mclBnG2_isValid(in G2 x);
         [DllImport(dllName)] public static extern int mclBnG2_isEqual(in G2 x, in G2 y);
         [DllImport(dllName)] public static extern int mclBnG2_isZero(in G2 x);
-        [DllImport(dllName)] public static extern int mclBnG2_hashAndMapTo(ref G2 x, [In][MarshalAs(UnmanagedType.LPStr)] string buf, long bufSize);
+        [DllImport(dllName)] public static extern int mclBnG2_hashAndMapTo(ref G2 x, [In]byte[] buf, long bufSize);
         [DllImport(dllName)] public static extern long mclBnG2_getStr([Out] StringBuilder buf, long maxBufSize, in G2 x, int ioMode);
         [DllImport(dllName)] public static extern void mclBnG2_neg(ref G2 y, in G2 x);
         [DllImport(dllName)] public static extern void mclBnG2_dbl(ref G2 y, in G2 x);
@@ -415,11 +415,15 @@
             {
                 mclBnFr_setByCSPRNG(ref this);
             }
-            public void SetHashOf(String s)
-            {
-                if (mclBnFr_setHashOf(ref this, s, s.Length) != 0) {
-                    throw new InvalidOperationException("mclBnFr_setHashOf:" + s);
-                }
+            public void SetHashOf(byte[] buf)
+            {
+                if (mclBnFr_setHashOf(ref this, buf, buf.Length) != 0) {
+                    throw new InvalidOperationException("mclBnFr_setHashOf:" + buf);
+                }
+            }
+            public void SetHashOf(string s)
+            {
+                SetHashOf(Encoding.UTF8.GetBytes(s));
             }
             public string GetStr(int ioMode)
             {
@@ -696,15 +700,23 @@
             {
                 return mclBnG1_isZero(this) == 1;
             }
+            public void HashAndMapTo(byte[] buf)
+            {
+                if (mclBnG1_hashAndMapTo(ref this, buf, buf.Length) != 0) {
+                    throw new ArgumentException("mclBnG1_hashAndMapTo:" + buf);
+                }
+            }
+            public void SetHashOf(byte[] buf)
+            {
+                HashAndMapTo(buf);
+            }
             public void HashAndMapTo(String s)
             {
-                if (mclBnG1_hashAndMapTo(ref this, s, s.Length) != 0) {
-                    throw new ArgumentException("mclBnG1_hashAndMapTo:" + s);
-                }
+                HashAndMapTo(Encoding.UTF8.GetBytes(s));
             }
             public void SetHashOf(String s)
             {
-                HashAndMapTo(s);
+                SetHashOf(Encoding.UTF8.GetBytes(s));
             }
             public string GetStr(int ioMode)
             {
@@ -810,15 +822,23 @@
             {
                 return mclBnG2_isZero(this) == 1;
             }
+            public void HashAndMapTo(byte[] buf)
+            {
+                if (mclBnG2_hashAndMapTo(ref this, buf, buf.Length) != 0) {
+                    throw new ArgumentException("mclBnG2_hashAndMapTo:" + buf);
+                }
+            }
+            public void SetHashOf(byte[] buf)
+            {
+                HashAndMapTo(buf);
+            }
             public void HashAndMapTo(String s)
             {
-                if (mclBnG2_hashAndMapTo(ref this, s, s.Length) != 0) {
-                    throw new ArgumentException("mclBnG2_hashAndMapTo:" + s);
-                }
+                HashAndMapTo(Encoding.UTF8.GetBytes(s));
             }
             public void SetHashOf(String s)
             {
-                HashAndMapTo(s);
+                SetHashOf(Encoding.UTF8.GetBytes(s));
             }
             public string GetStr(int ioMode)
             {


Version 1.3.14.0.

Version 1.3.14.0.

--- Oogi/Oogi/Properties/AssemblyInfo.cs
+++ Oogi/Oogi/Properties/AssemblyInfo.cs
@@ -31,5 +31,5 @@
 // You can specify all the values or you can default the Build and Revision Numbers
 // by using the '*' as shown below:
 // [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.3.13.0")]
-[assembly: AssemblyFileVersion("1.3.13.0")]
+[assembly: AssemblyVersion("1.3.14.0")]
+[assembly: AssemblyFileVersion("1.3.14.0")]


fixed null exceptions

fixed null exceptions

--- PastingSharp/PastingSharp/Program.cs
+++ PastingSharp/PastingSharp/Program.cs
@@ -9,17 +9,18 @@

 namespace PastingSharp
 {
-    public class Program
+     class Program
     {
-        public static string contents = "";
-        public static string[] linestoprint;
-        public static Menu menu;
-        public static void Main(string[] args)
+         static string contents = "";
+         static string[] linestoprint;
+         static Menu menu;
+         static int _lastPaste;
+         static void Main(string[] args)
         {
             CustomEvents.Game.OnGameLoad += Game_OnGameLoad;
         }

-        public static void Game_OnGameLoad(EventArgs args)
+         static void Game_OnGameLoad(EventArgs args)
         {

             menu = new Menu("PastingSharp", "pasting", true);
@@ -30,7 +31,7 @@

             Game.OnGameUpdate += Game_OnGameUpdate;
         }
-        public static void Game_OnGameUpdate(EventArgs args)
+         static void Game_OnGameUpdate(EventArgs args)
         {

             if (forms.Clipboard.ContainsText())
@@ -45,23 +46,56 @@

             if (menu.Item("paste").GetValue<KeyBind>().Active)
             {
-                if (linestoprint == null)
+
+                var sleep = (menu.Item("sleep").GetValue<int>()) * 1000;
+                if (sleep == 0)
                 {
-                    Game.Say(contents);
+                    if (linestoprint == null && contents != null)
+                    {
+                        Game.Say(contents);
+                        _lastPaste = Environment.TickCount;
+                    }
+                    else if (linestoprint != null)
+                    {
+                        foreach (string s in linestoprint)
+                        {
+                            Game.Say(s);
+                        }
+                        var linestoprintsize = contents.Count();
+                        Array.Clear(linestoprint, 0, linestoprintsize);
+                        _lastPaste = Environment.TickCount;
+                    }
+                    if (linestoprint == null && contents == null)
+                    {
+                        Game.PrintChat("Your clipboard is empty, are you sure you copied something?");
+                    }
                 }
-                else
-                {
-                    foreach (string s in linestoprint)
-                    {
-                        Game.Say(s);
-                    }
-                    var linestoprintsize = contents.Count();
-                    Array.Clear(linestoprint, 0, linestoprintsize);
-                }
-                var sleep = (menu.Item("sleep").GetValue<int>()) * 1000;
                 if (sleep != 0)
                 {
-                    System.Threading.Thread.Sleep(sleep);
+                    if (Environment.TickCount - _lastPaste > sleep || _lastPaste == 0)
+                    {
+                        if (linestoprint == null && contents != null)
+                        {
+                            Game.Say(contents);
+                            _lastPaste = Environment.TickCount;
+                        }
+                        else if (linestoprint != null)
+                        {
+                            foreach (string s in linestoprint)
+                            {
+                                Game.Say(s);
+                            }
+                            var linestoprintsize = contents.Count();
+                            Array.Clear(linestoprint, 0, linestoprintsize);
+                            _lastPaste = Environment.TickCount;
+                        }
+                        if (linestoprint == null && contents == null)
+                        {
+                            Game.PrintChat("Your clipboard is empty, are you sure you copied something?");
+                        }
+
+
+                    }
                 }
             }


removed code that should have been remmoved with ternary statement

--- PathLib.UnitTest/PurePathUnitTest.cs
+++ PathLib.UnitTest/PurePathUnitTest.cs
@@ -62,16 +62,7 @@

                 if (String.IsNullOrEmpty(remainingPath) == false)
                 {
-
                     return _getFileNameOrDirectoryName(remainingPath, currentDirectoryIdentifier);
-                    if (remainingPath != currentDirectoryIdentifier)
-                    {
-                        return PathUtils.GetFileNameWithoutExtension(remainingPath, PathSeparator);
-                    }
-                    else
-                    {
-                        return currentDirectoryIdentifier;
-                    }
                 }

                 return null;


Prevent NullReferenceException in ExecutableExecuteEvent

--- Pathfinder/Event/ExecutableEvents.cs
+++ Pathfinder/Event/ExecutableEvents.cs
@@ -21,10 +21,8 @@
         {
             Computer = com;
             OS = os;
-            if(name != null)
-                ExecutableName = name;
-            if(data != null)
-                ExecutableData = data;
+            ExecutableName = name;
+            ExecutableData = data;
             Arguments = new List<string>(args ?? Utility.Array<string>.Empty);
         }
     }
@@ -34,22 +32,26 @@
         public Folder Folder { get; private set; }
         public int FileIndex { get; private set; }
         public GameFilesystem.File File { get; private set; }
-        public FileEntry ExecutableFile => File.Object;
+        public FileEntry ExecutableFile => File?.Object;
         public Executable.ExecutionResult Result { get; set; } = Executable.ExecutionResult.NotFound;
         public new string ExecutableName
         {
-            get { return ExecutableFile.name; }
+            get { return ExecutableFile?.name; }
             set
             {
+                if (ExecutableFile == null || value == null)
+                    return;
                 ExecutableFile.name = value;
                 ((ExecutableEvent)this).ExecutableName = value;
             }
         }
         public new string ExecutableData
         {
-            get { return ExecutableFile.data; }
+            get { return ExecutableFile?.data; }
             set
             {
+                if (ExecutableFile == null || value == null)
+                    return;
                 ExecutableFile.data = value;
                 ((ExecutableEvent)this).ExecutableData = value;
             }
@@ -64,8 +66,8 @@
             Folder = fol;
             FileIndex = finde;
             File = file;
-            ExecutableName = file.Name;
-            ExecutableData = file.Data;
+            ExecutableName = file?.Name;
+            ExecutableData = file?.Data;
         }
     }


Add resource link to remarks

Add resource link to remarks

--- Assets/MixedRealityToolkit.Providers/WindowsMixedReality/WindowsMixedRealityUtilities.cs
+++ Assets/MixedRealityToolkit.Providers/WindowsMixedReality/WindowsMixedRealityUtilities.cs
@@ -23,10 +23,13 @@

         /// <summary>
         /// Helps marshal WinRT IInspectable objects that have been passed to managed code as an IntPtr.
+        /// </summary>
+        /// <remarks>
         /// On .NET Native, IInspectable pointers cannot be marshaled from native to managed code using Marshal.GetObjectForIUnknown.
         /// This class calls into a native method that specifically marshals the type as a specific WinRT interface, which
         /// is supported by the marshaller on both .NET Core and .NET Native.
-        /// </summary>
+        /// Please see https://microsoft.github.io/MixedRealityToolkit-Unity/Documentation/InputSystem/HandTracking.html#net-native for more info.
+        /// </remarks>
         private static SpatialCoordinateSystem GetSpatialCoordinateSystem(IntPtr nativePtr)
         {
             try


Remove a unit tests added for dev tests

Remove a unit tests added for dev tests

--- src/ReverseMarkdown.Test/ConverterTests.cs
+++ src/ReverseMarkdown.Test/ConverterTests.cs
@@ -1364,18 +1364,5 @@

             Assert.Equal(expected, result);
         }
-
-        [Fact]
-        public void When_PRE_With_Content_Convert_Ensure_LineBreaks_Are_Retained()
-        {
-            var html = File.ReadAllText("C:\\Users\\babua\\Downloads\\PageProjectDescription(2)\\PageProjectDescription.html");
-            var converter = new Converter(new Config
-            {
-                GithubFlavored = true,
-                DefaultCodeBlockLanguage = "powershell"
-            });
-            var result = converter.Convert(html);
-            File.WriteAllText("C:\\Users\\babua\\Downloads\\PageProjectDescription(2)\\PageProjectDescription.md", result);
-        }
     }
 }


async

async

--- MasDev.Common/Services/MasDev.Services.Core/Source/Authorization/AuthorizationManager.cs
+++ MasDev.Common/Services/MasDev.Services.Core/Source/Authorization/AuthorizationManager.cs
@@ -18,7 +18,7 @@

 		Task AuthorizeAsync (int? minimumRequiredRoles = null);

-		Task<DateTime> RenewIssueTime (Identity identity);
+		Task<DateTime> RenewIssueTimeAsync (Identity identity);
 	}

 	public class AuthorizationManager : IAuthorizationManager
@@ -81,7 +81,7 @@
 				throw new UnauthorizedException ();
 		}

-		public async Task<DateTime> RenewIssueTime (Identity identity)
+		public async Task<DateTime> RenewIssueTimeAsync (Identity identity)
 		{
 			var now = DateTime.UtcNow;
 			await _credentialsRepositoryFactory ().SetInvalidationTime (identity.Id, identity.Flag, now);


Fix RoundTripEntityWorks

Fix RoundTripEntityWorks

--- OData/test/E2ETest/WebStack.QA.Test.OData/Formatter/Untyped/UntypedSerializationTests.cs
+++ OData/test/E2ETest/WebStack.QA.Test.OData/Formatter/Untyped/UntypedSerializationTests.cs
@@ -13,6 +13,7 @@
 using System.Web.OData.Builder;
 using System.Web.OData.Extensions;
 using System.Web.OData.Query;
+using System.Web.OData.Query.Validators;
 using System.Web.OData.Routing;
 using System.Web.OData.Routing.Conventions;
 using Microsoft.OData.Edm;
@@ -270,7 +271,7 @@
             }

             ODataQueryContext context = new ODataQueryContext(Request.ODataProperties().Model, CustomerType, path: null,
-                requestContainer: null);
+                requestContainer: new MockContainer());
             ODataQueryOptions query = new ODataQueryOptions(context, Request);
             if (query.SelectExpand != null)
             {
@@ -396,6 +397,30 @@
             return address;
         }
     }
+
+    public class MockContainer : IServiceProvider
+    {
+        public object GetService(Type serviceType)
+        {
+            if (serviceType == typeof(DefaultQuerySettings))
+            {
+                return new DefaultQuerySettings();
+            }
+
+            if (serviceType == typeof(SelectExpandQueryValidator))
+            {
+                return new SelectExpandQueryValidator(new DefaultQuerySettings());
+            }
+
+            if (serviceType == typeof(ODataQueryValidator))
+            {
+                return new ODataQueryValidator();
+            }
+
+            throw new NotImplementedException();
+        }
+    }
+
     public class UntypedCustomer
     {
         public int Id { get; set; }


when importing a savegame with unknown species, display the concerning species-class names.

--- ARKBreedingStats/ImportSavegame.cs
+++ ARKBreedingStats/ImportSavegame.cs
@@ -53,17 +53,18 @@
             List<Creature> creatures = tamedCreatureObjects.Select(o => importSavegame.convertGameObject(o, wildLevelStep)).ToList();

             // if there are creatures with unknown species, check if the according mod-file is available
-            var unknownSpeciesCreatures = creatures.Where(c => c == null).ToList();
+            var unknownSpeciesCreatures = creatures.Where(c => c.Species == null).ToList();

             if (!unknownSpeciesCreatures.Any()
                || MessageBox.Show("The species of " + unknownSpeciesCreatures.Count.ToString() + " creature" + (unknownSpeciesCreatures.Count != 1 ? "s" : "") + " is not recognized, probably because they are from a mod that is not loaded.\n"
                                   + "Do you want to import the recognized creatures?\n\n"
-                                  + "(To import the unrecognized creatures, you first need additional values-files.)",
-                                  "Unrecognized species", MessageBoxButtons.YesNo, MessageBoxIcon.Question
+                                  + "(To import the unrecognized creatures, you first need additional values-files.)\n\n"
+                                  + "The unrecognized species-classes are: " + string.Join(", ", unknownSpeciesCreatures.Select(c => c.name).Distinct().ToArray()),
+                                  "Unrecognized species while importing savegame", MessageBoxButtons.YesNo, MessageBoxIcon.Question
                                  ) == DialogResult.Yes
                )
             {
-                importCollection(creatureCollection, creatures.Where(c => c != null).ToList(), serverName);
+                importCollection(creatureCollection, creatures.Where(c => c.Species != null).ToList(), serverName);
             }
         }

@@ -134,7 +135,8 @@
             if (!Values.V.TryGetSpeciesByClassName(creatureObject.ClassString, out Species species))
             {
                 // species is unknown, creature cannot be imported.
-                return null;
+                // use name-field to temporarily save the unknown classString to display in a messagebox
+                return new Creature { name = creatureObject.ClassString };
             }

             GameObject statusObject = creatureObject.CharacterStatusComponent();


Fix invalid TestMethod flag on a helper class

--- ATL.test/IO/MetaData/MetaIOTest.cs
+++ ATL.test/IO/MetaData/MetaIOTest.cs
@@ -221,7 +221,6 @@
             if (deleteTempFile) File.Delete(testFileLocation);
         }

-        [TestMethod]
         public void test_RW_Empty(string fileName, bool deleteTempFile = true, bool sameSizeAfterEdit = false, bool sameBitsAfterEdit = false)
         {
             ConsoleLogger log = new ConsoleLogger();


escape parameter name to support special characters

--- src/SIM.Sitecore9Installer/SitecoreTask.cs
+++ src/SIM.Sitecore9Installer/SitecoreTask.cs
@@ -167,8 +167,8 @@

         string value = this.GetParameterValue(param);
-
-        installParams.AppendLine(string.Format("{0}={1}", param.Name, value));
+        string paramName = "{" + param.Name + "}";
+        installParams.AppendLine(string.Format("{0}={1}", paramName, value));

       }

@@ -182,7 +182,8 @@
       foreach (InstallParam param in this.GlobalParams)
       {
         string value = GetParameterValue(param);
-        script.AppendLine(string.Format("{0}{1}={2}",addPrefix?"$":string.Empty ,param.Name, value));
+        string paramName = "{" + param.Name + "}";
+        script.AppendLine(string.Format("{0}{1}={2}",addPrefix?"$":string.Empty ,paramName, value));
       }

       return script.ToString();


Some more work on Structural -> Physical conversion.

--- Source/CILAssemblyManipulator/CILAssemblyManipulator.Structural/Structural.ToPhysical.cs
+++ Source/CILAssemblyManipulator/CILAssemblyManipulator.Structural/Structural.ToPhysical.cs
@@ -25,17 +25,115 @@

 public static partial class E_CILStructural
 {
+   private sealed class TableIndexTracker<T>
+      where T : class
+   {
+      private readonly Tables _table;
+      private readonly IDictionary<T, Int32> _dic;
+      private readonly Action<T, Int32> _afterAddition;
+
+      internal TableIndexTracker( Tables table, Action<T, Int32> afterAddition )
+      {
+         this._table = table;
+         this._dic = new Dictionary<T, Int32>( ReferenceEqualityComparer<T>.ReferenceBasedComparer );
+         this._afterAddition = afterAddition;
+      }
+
+      public TableIndex Add( T obj )
+      {
+         if ( obj == null )
+         {
+            throw new InvalidOperationException( "Trying to add null to table " + this._table + "." );
+         }
+
+         var idx = this._dic.Count;
+         this._dic.Add( obj, idx );
+         this._afterAddition( obj, idx );
+         return new TableIndex( this._table, idx );
+      }
+
+      public TableIndex Get( T obj )
+      {
+         TableIndex retVal;
+         if ( !this.TryGet( obj, out retVal ) )
+         {
+            throw new InvalidOperationException( "The " + this._table + " object " + obj + " was not part of this module." );
+         }
+         return retVal;
+      }
+
+      public TableIndex GetOrAdd( T obj )
+      {
+         Int32 idx;
+         return this._dic.TryGetValue( obj, out idx ) ?
+            new TableIndex( this._table, idx ) :
+            this.Add( obj );
+      }
+
+      public Boolean TryGet( T obj, out TableIndex index )
+      {
+         if ( obj == null )
+         {
+            throw new InvalidOperationException( "Null reference to table " + this._table + "." );
+         }
+         Int32 idx;
+         var retVal = this._dic.TryGetValue( obj, out idx );
+         index = retVal ? new TableIndex( this._table, idx ) : default( TableIndex );
+         return retVal;
+      }
+
+      public Int32 Count
+      {
+         get
+         {
+            return this._dic.Count;
+         }
+      }
+   }
    private sealed class PhysicalCreationState
    {
       private readonly CILMetaData _md;
-      private readonly IDictionary<TypeDefinitionStructure, Int32> _typeDefs;
+      private readonly TableIndexTracker<TypeDefinitionStructure> _typeDefs;
+      private readonly TableIndexTracker<FieldStructure> _fieldDefs;
+      private readonly TableIndexTracker<MethodStructure> _methodDefs;
+      private readonly TableIndexTracker<ParameterStructure> _paramDefs;
       //private readonly IDictionary<TypeReferenceStructure, Int32> _typeRefs;
       //private readonly IDictionary<TypeSpecificationStructure, Int32> _typeSpecs;

       internal PhysicalCreationState( CILMetaData md, ModuleStructure module )
       {
          this._md = md;
-         this._typeDefs = new Dictionary<TypeDefinitionStructure, Int32>( ReferenceEqualityComparer<TypeDefinitionStructure>.ReferenceBasedComparer );
+         this._typeDefs = new TableIndexTracker<TypeDefinitionStructure>( Tables.TypeDef, ( tDef, idx ) =>
+            md.TypeDefinitions.TableContents.Add( new TypeDefinition()
+            {
+               Attributes = tDef.Attributes,
+               FieldList = new TableIndex( Tables.Field, this._fieldDefs.Count ),
+               MethodList = new TableIndex( Tables.MethodDef, this._methodDefs.Count ),
+               Name = tDef.Name,
+               Namespace = tDef.Namespace
+            } ) );
+         this._fieldDefs = new TableIndexTracker<FieldStructure>( Tables.Field, ( fDef, idx ) =>
+            md.FieldDefinitions.TableContents.Add( new FieldDefinition()
+            {
+               Attributes = fDef.Attributes,
+               Name = fDef.Name
+            } ) );
+         this._methodDefs = new TableIndexTracker<MethodStructure>( Tables.MethodDef, ( mDef, idx ) =>
+            md.MethodDefinitions.TableContents.Add( new MethodDefinition()
+            {
+               Attributes = mDef.Attributes,
+               ImplementationAttributes = mDef.ImplementationAttributes,
+               Name = mDef.Name,
+               ParameterList = new TableIndex( Tables.Parameter, this._paramDefs.Count )
+            } ) );
+         this._paramDefs = new TableIndexTracker<ParameterStructure>( Tables.Parameter, ( pDef, idx ) =>
+            md.ParameterDefinitions.TableContents.Add( new ParameterDefinition()
+            {
+               Attributes = pDef.Attributes,
+               Name = pDef.Name,
+               Sequence = pDef.Sequence
+            } ) );
+
          //this._typeRefs = new Dictionary<TypeReferenceStructure, Int32>( ReferenceEqualityComparer<TypeReferenceStructure>.ReferenceBasedComparer );
          //this._typeSpecs = new Dictionary<TypeSpecificationStructure, Int32>( ReferenceEqualityComparer<TypeSpecificationStructure>.ReferenceBasedComparer );

@@ -50,7 +148,7 @@
          }
       }

-      public IDictionary<TypeDefinitionStructure, Int32> TypeDefs
+      public TableIndexTracker<TypeDefinitionStructure> TypeDefs
       {
          get
          {
@@ -58,39 +156,39 @@
          }
       }

-      //public IDictionary<TypeReferenceStructure, Int32> TypeRefs
-      //{
-      //   get
-      //   {
-      //      return this._typeRefs;
-      //   }
-      //}
-
-      //public IDictionary<TypeSpecificationStructure, Int32> TypeSpecs
-      //{
-      //   get
-      //   {
-      //      return this._typeSpecs;
-      //   }
-      //}
-
-      public IDictionary<FieldStructure, Int32> FieldDefs
-      {
-         get
-         {
-            throw new NotImplementedException();
-         }
-      }
-
-      public IDictionary<MethodStructure, Int32> MethodDefs
-      {
-         get
-         {
-            throw new NotImplementedException();
-         }
-      }
-
-      public IDictionary<ParameterStructure, Int32> ParamDefs
+      public TableIndexTracker<TypeReferenceStructure> TypeRefs
+      {
+         get
+         {
+            throw new NotImplementedException();
+         }
+      }
+
+      public TableIndexTracker<TypeSpecificationStructure> TypeSpecs
+      {
+         get
+         {
+            throw new NotImplementedException();
+         }
+      }
+
+      public TableIndexTracker<FieldStructure> FieldDefs
+      {
+         get
+         {
+            throw new NotImplementedException();
+         }
+      }
+
+      public TableIndexTracker<MethodStructure> MethodDefs
+      {
+         get
+         {
+            throw new NotImplementedException();
+         }
+      }
+
+      public TableIndexTracker<ParameterStructure> ParamDefs
       {
          get
          {
@@ -141,70 +239,33 @@
    {
       var md = state.MetaData;
       var tDefs = md.TypeDefinitions.TableContents;
-      var tDefIdx = tDefs.Count;
-
       // TypeDef
-      tDefs.Add( new TypeDefinition()
-      {
-         Attributes = typeDef.Attributes,
-         FieldList = md.GetNextTableIndexFor( Tables.Field ),
-         MethodList = md.GetNextTableIndexFor( Tables.MethodDef ),
-         Name = typeDef.Name,
-         Namespace = typeDef.Namespace
-      } );
-      state.TypeDefs.Add( typeDef, tDefIdx );
+      var tDefIdx = state.TypeDefs.Add( typeDef );

       // NestedClass
       if ( enclosingType != null )
       {
          md.NestedClassDefinitions.TableContents.Add( new NestedClassDefinition()
          {
-            NestedClass = new TableIndex( Tables.TypeDef, tDefIdx ),
-            EnclosingClass = new TableIndex( Tables.TypeDef, state.TypeDefs[enclosingType] )
+            NestedClass = tDefIdx,
+            EnclosingClass = state.TypeDefs.Get( enclosingType )
          } );
       }

       // Fields
-      var fDefs = md.FieldDefinitions.TableContents;
-      var fDefIdx = fDefs.Count;
       foreach ( var field in typeDef.Fields )
       {
-         fDefs.Add( new FieldDefinition()
-         {
-            Attributes = field.Attributes,
-            Name = field.Name
-         } );
-         state.FieldDefs.Add( field, fDefIdx );
-         ++fDefIdx;
+         state.FieldDefs.Add( field );
       }

       // Methods and Parameters
-      var mDefs = md.MethodDefinitions.TableContents;
-      var mDefIdx = mDefs.Count;
-      var pDefs = md.ParameterDefinitions.TableContents;
-      var pDefIdx = pDefs.Count;
       foreach ( var method in typeDef.Methods )
       {
-         mDefs.Add( new MethodDefinition()
-         {
-            Attributes = method.Attributes,
-            ImplementationAttributes = method.ImplementationAttributes,
-            Name = method.Name,
-            ParameterList = new TableIndex( Tables.Parameter, pDefIdx )
-         } );
-         state.MethodDefs.Add( method, mDefIdx );
-         ++mDefIdx;
+         state.MethodDefs.Add( method );

          foreach ( var param in method.Parameters )
          {
-            pDefs.Add( new ParameterDefinition()
-            {
-               Attributes = param.Attributes,
-               Name = param.Name,
-               Sequence = param.Sequence
-            } );
-            state.ParamDefs.Add( param, pDefIdx );
-            ++pDefIdx;
+            state.ParamDefs.Add( param );
          }
       }

@@ -230,8 +291,11 @@
       switch ( type.TypeStructureKind )
       {
          case TypeStructureKind.TypeDef:
+            return state.TypeDefs.Get( (TypeDefinitionStructure) type );
          case TypeStructureKind.TypeRef:
+            return state.TypeRefs.Get( (TypeReferenceStructure) type );
          case TypeStructureKind.TypeSpec:
+            return state.TypeSpecs.Get( (TypeSpecificationStructure) type );
          default:
             throw new InvalidOperationException( "Invalid type structure kind: " + type.TypeStructureKind + "." );
       }


Added additional format so dates without time can be parsed

--- src/ServiceBase/Mvc/DateTimeModelBinder.cs
+++ src/ServiceBase/Mvc/DateTimeModelBinder.cs
@@ -9,7 +9,8 @@
     {
         private static readonly string[] DateTimeFormats = {
             "yyyyMMdd'T'HHmmss.FFFFFFFK",
-            "yyyy-MM-dd'T'HH:mm:ss.FFFFFFFK"
+            "yyyy-MM-dd'T'HH:mm:ss.FFFFFFFK",
+            "yyyy-MM-dd"
         };

         public Task BindModelAsync(ModelBindingContext bindingContext)


removed superfluous attribute from gen code

--- Source/nHydrate.Generator.EFCodeFirst/Generators/SQLHelper/SQLHelperGeneratedTemplate.cs
+++ Source/nHydrate.Generator.EFCodeFirst/Generators/SQLHelper/SQLHelperGeneratedTemplate.cs
@@ -109,7 +109,6 @@
         {
             sb.AppendLine("	#region LinqSQLField");
             sb.AppendLine();
-            sb.AppendLine("	[System.CodeDom.Compiler.GeneratedCode(\"nHydrateModelGenerator\", \"" + _model.ModelToolVersion + "\")]");
             sb.AppendLine("	internal class LinqSQLField");
             sb.AppendLine("	{");
             sb.AppendLine("		public string Name { get; set; }");
@@ -142,7 +141,6 @@
             sb.AppendLine();
             sb.AppendLine("	#region LinqSQLFromClause");
             sb.AppendLine();
-            sb.AppendLine("	[System.CodeDom.Compiler.GeneratedCode(\"nHydrateModelGenerator\", \"" + _model.ModelToolVersion + "\")]");
             sb.AppendLine("	internal class LinqSQLFromClause");
             sb.AppendLine("	{");
             sb.AppendLine("		public string TableName { get; set; }");
@@ -161,7 +159,6 @@
             sb.AppendLine("		}");
             sb.AppendLine("	}");
             sb.AppendLine();
-            sb.AppendLine("	[System.CodeDom.Compiler.GeneratedCode(\"nHydrateModelGenerator\", \"" + _model.ModelToolVersion + "\")]");
             sb.AppendLine("	internal class LinqSQLFromClauseCollection : List<LinqSQLFromClause>");
             sb.AppendLine("	{");
             sb.AppendLine("		public bool ContainsTable(string tableName)");
@@ -293,7 +290,6 @@
             sb.AppendLine("	#region BusinessObjectQuery");
             sb.AppendLine();
             sb.AppendLine("	delegate string GetDatabaseFieldNameDelegate(string field);");
-            sb.AppendLine("	[System.CodeDom.Compiler.GeneratedCode(\"nHydrateModelGenerator\", \"" + _model.ModelToolVersion + "\")]");
             sb.AppendLine("	internal partial class BusinessObjectQuery<T, K, P>");
             sb.AppendLine("		where T : class, IBusinessObject");
             sb.AppendLine("		where K : class, IBusinessObjectLINQQuery");
@@ -606,7 +602,6 @@
             sb.AppendLine();
             sb.AppendLine("	#region LinqSQLParser");
             sb.AppendLine();
-            sb.AppendLine("	[System.CodeDom.Compiler.GeneratedCode(\"nHydrateModelGenerator\", \"" + _model.ModelToolVersion + "\")]");
             sb.AppendLine("	internal partial class LinqSQLParser");
             sb.AppendLine("	{");
             sb.AppendLine("		internal enum ObjectTypeConstants");
@@ -1145,7 +1140,6 @@

             sb.AppendLine("	#region GlobalValues");
             sb.AppendLine();
-            sb.AppendLine("	[System.CodeDom.Compiler.GeneratedCode(\"nHydrateModelGenerator\", \"" + _model.ModelToolVersion + "\")]");
             sb.AppendLine("	internal static class GlobalValues");
             sb.AppendLine("	{");
             sb.AppendLine("		public const string ERROR_PROPERTY_NULL = \"The value is null and in an invalid state.\";");
@@ -1490,7 +1484,6 @@

             sb.AppendLine("	#region Extensions");
             sb.AppendLine();
-            sb.AppendLine("	[System.CodeDom.Compiler.GeneratedCode(\"nHydrateModelGenerator\", \"" + _model.ModelToolVersion + "\")]");
             sb.AppendLine("	internal static class Extensions");
             sb.AppendLine("	{");
             sb.AppendLine("		public static bool Contains(this DataRelationCollection relationList, DataRelation relation)");


Revert the basepath change

Revert the basepath change

Pretty certain this is needed to make production configs work

--- src/Tgstation.Server.Host/ServerFactory.cs
+++ src/Tgstation.Server.Host/ServerFactory.cs
@@ -49,7 +49,10 @@

 			var basePath = IOManager.ResolvePath();
 			IHostBuilder CreateDefaultBuilder() => Microsoft.Extensions.Hosting.Host.CreateDefaultBuilder(args)
-				.ConfigureAppConfiguration((context, builder) => {
+				.ConfigureAppConfiguration((context, builder) =>
+				{
+					builder.SetBasePath(basePath);
+
 					builder.AddYamlFile("appsettings.yml", optional: true, reloadOnChange: true)
 						.AddYamlFile($"appsettings.{context.HostingEnvironment.EnvironmentName}.yml", optional: true, reloadOnChange: true);
 					// reorganize the builder so our yaml configs don't override the env/cmdline configs