diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json
index 4fea1c2..2a93aa0 100644
--- a/.config/dotnet-tools.json
+++ b/.config/dotnet-tools.json
@@ -3,7 +3,7 @@
"isRoot": true,
"tools": {
"jetbrains.resharper.globaltools": {
- "version": "2020.3.3",
+ "version": "2021.2.2",
"commands": [
"jb"
]
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 2f547dd..d922ed4 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,9 @@
# Changelog
+## v1.4.5 - 2021.11.30
+- Add net6.0 support.
+- Update dependencies.
+
## v1.4.2 - 2021.04.28
- Support LINQ `Distinct` and `Count` methods
diff --git a/Common.DotSettings b/Common.DotSettings
index 6fd132b..5adb19b 100644
--- a/Common.DotSettings
+++ b/Common.DotSettings
@@ -138,6 +138,7 @@
False
False
False
+ False
AP
AB
TTN
diff --git a/Directory.Build.props b/Directory.Build.props
index 7e94621..c485c94 100644
--- a/Directory.Build.props
+++ b/Directory.Build.props
@@ -13,8 +13,8 @@
-
-
+
+
\ No newline at end of file
diff --git a/Mutators.Tests/Mutators.Tests.csproj b/Mutators.Tests/Mutators.Tests.csproj
index a338874..51ac4af 100644
--- a/Mutators.Tests/Mutators.Tests.csproj
+++ b/Mutators.Tests/Mutators.Tests.csproj
@@ -2,14 +2,14 @@
false
- net48;netcoreapp3.1;net5.0
+ net48;netcoreapp3.1;net5.0;net6.0
-
-
-
-
+
+
+
+
diff --git a/Mutators/Mutators.csproj b/Mutators/Mutators.csproj
index ab02438..bdc90df 100644
--- a/Mutators/Mutators.csproj
+++ b/Mutators/Mutators.csproj
@@ -13,9 +13,9 @@
-
-
-
+
+
+
diff --git a/Mutators/ValidationResultTreeNode.cs b/Mutators/ValidationResultTreeNode.cs
index 9e011f2..84dfc69 100644
--- a/Mutators/ValidationResultTreeNode.cs
+++ b/Mutators/ValidationResultTreeNode.cs
@@ -334,9 +334,6 @@ private static Action, int> EmitForceCount()
{
var listType = typeof(List);
var method = new DynamicMethod(Guid.NewGuid().ToString(), typeof(void), new[] {listType, typeof(int)}, typeof(string), true);
- var ensureCapacityMethod = listType.GetMethod("EnsureCapacity", BindingFlags.Instance | BindingFlags.NonPublic);
- if (ensureCapacityMethod == null)
- throw new InvalidOperationException("Method 'List<>.EnsureCapacity' is missing");
var _sizeField = listType.GetField("_size", BindingFlags.Instance | BindingFlags.NonPublic);
if (_sizeField == null)
throw new InvalidOperationException("The field 'List<>._size' is not found");
@@ -344,7 +341,15 @@ private static Action, int> EmitForceCount()
{
il.Ldarg(0); // stack: [list]
il.Ldarg(1); // stack: [list, size]
- il.Call(ensureCapacityMethod); // list.EnsureCapacity(size); stack: []
+ if (PlatformHelpers.IsDotNet60OrGreater)
+ {
+ il.Call(listType.GetMethod("EnsureCapacity", BindingFlags.Instance | BindingFlags.Public)); // list.EnsureCapacity(size); stack: [newCapacity]
+ il.Pop();
+ }
+ else
+ {
+ il.Call(listType.GetMethod("EnsureCapacity", BindingFlags.Instance | BindingFlags.NonPublic)); // list.EnsureCapacity(size); stack: []
+ }
il.Ldarg(0); // stack: [list]
il.Ldarg(1); // stack: [list, size]
il.Stfld(_sizeField); // list._size = size; stack: []
diff --git a/appveyor.yml b/appveyor.yml
index 3a69d26..5622046 100644
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -4,7 +4,7 @@ skip_commits:
files:
- '**/*.md'
-image: Visual Studio 2019
+image: Visual Studio 2022
init:
- cmd: git config --global core.autocrlf false
@@ -53,7 +53,7 @@ deploy:
- provider: NuGet
server: https://nuget.org
api_key:
- secure: y2RPf+gBBqffQVm8pg9qZcg99m7K8hsSa4z7VHvIE6t+kuO7r/oIqTVcryZzL93D
+ secure: 3Myenol+seNdEnkmH7tadxQLsmOE7VWQSp6vQii4vt2dX1S7XwjNV4T24HQTUsrr
skip_symbols: true
on:
SHOULD_PUBLISH_NUGET_PACKAGE: true
diff --git a/global.json b/global.json
index 2d85e85..d6c2c37 100644
--- a/global.json
+++ b/global.json
@@ -1,5 +1,6 @@
{
"sdk": {
- "version": "5.0.202"
+ "version": "6.0.100",
+ "rollForward": "latestFeature"
}
}
\ No newline at end of file