diff --git a/.editorconfig b/.editorconfig
index 0e572fa692..a25f791987 100644
--- a/.editorconfig
+++ b/.editorconfig
@@ -4,7 +4,7 @@ root = true
indent_style = tab
[*.csproj]
-indent_style = space
+indent_style = tab
indent_size = 2
[*.cs]
diff --git a/CHANGELOG.md b/CHANGELOG.md
index b19e92f2da..51a7fd4288 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -2,6 +2,9 @@
## Unreleased
+Enhancements:
+- .NET Standard 2.0 and 2.1 support (@lg2de, #485)
+
Deprecations:
- Removed support for the .NET Framework 3.5.
diff --git a/Castle.Core.sln b/Castle.Core.sln
index 892e7ff67d..6c4815b64e 100644
--- a/Castle.Core.sln
+++ b/Castle.Core.sln
@@ -1,16 +1,18 @@
Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio 15
-VisualStudioVersion = 15.0.26403.7
+# Visual Studio Version 16
+VisualStudioVersion = 16.0.30011.22
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Castle Build", "Castle Build", "{1B999D24-B7AB-4997-96E7-08FA05325694}"
ProjectSection(SolutionItems) = preProject
+ .editorconfig = .editorconfig
.gitattributes = .gitattributes
.gitignore = .gitignore
appveyor.yml = appveyor.yml
build.cmd = build.cmd
build.sh = build.sh
CHANGELOG.md = CHANGELOG.md
+ buildscripts\common.props = buildscripts\common.props
CONTRIBUTING.md = CONTRIBUTING.md
LICENSE = LICENSE
README.md = README.md
@@ -69,4 +71,7 @@ Global
{344D907D-6641-4A61-94C2-4980B5804FE2} = {A598EE9B-41CE-4BE8-BF93-2C91F919F97E}
{91B2A82F-63F6-46B1-8EDC-5D029BCF6A2B} = {A598EE9B-41CE-4BE8-BF93-2C91F919F97E}
EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ SolutionGuid = {682D4399-4863-4813-B495-5FEDD22496ED}
+ EndGlobalSection
EndGlobal
diff --git a/Castle.Core.sln.DotSettings b/Castle.Core.sln.DotSettings
index 19a369c5de..7e2260edeb 100644
--- a/Castle.Core.sln.DotSettings
+++ b/Castle.Core.sln.DotSettings
@@ -255,6 +255,9 @@ limitations under the License.
$object$_On$event$
True
True
+ True
+ True
+ True
True
True
True
diff --git a/build.sh b/build.sh
index eea56cc55d..54d35cea69 100755
--- a/build.sh
+++ b/build.sh
@@ -4,9 +4,9 @@
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
-#
+#
# http://www.apache.org/licenses/LICENSE-2.0
-#
+#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -48,11 +48,11 @@ mono ./src/Castle.Core.Tests/bin/Release/net461/Castle.Core.Tests.exe --result=D
mono ./src/Castle.Core.Tests.WeakNamed/bin/Release/net461/Castle.Core.Tests.WeakNamed.exe --result=DesktopClrWeakNamedTestResults.xml;format=nunit3
echo ---------------------------
-echo Running NETCOREAPP1.1 Tests
+echo Running NETCOREAPP3.1 Tests
echo ---------------------------
-dotnet ./src/Castle.Core.Tests/bin/Release/netcoreapp1.1/Castle.Core.Tests.dll --result=NetCoreClrTestResults.xml;format=nunit3
-dotnet ./src/Castle.Core.Tests.WeakNamed/bin/Release/netcoreapp1.1/Castle.Core.Tests.WeakNamed.dll --result=NetCoreClrWeakNamedTestResults.xml;format=nunit3
+dotnet ./src/Castle.Core.Tests/bin/Release/netcoreapp3.1/Castle.Core.Tests.dll --result=NetCoreClrTestResults.xml;format=nunit3
+dotnet ./src/Castle.Core.Tests.WeakNamed/bin/Release/netcoreapp3.1/Castle.Core.Tests.WeakNamed.dll --result=NetCoreClrWeakNamedTestResults.xml;format=nunit3
# Ensure that all test runs produced a protocol file:
if [[ !( -f NetCoreClrTestResults.xml &&
diff --git a/buildscripts/build.cmd b/buildscripts/build.cmd
index 45992bd019..b1e29576f0 100644
--- a/buildscripts/build.cmd
+++ b/buildscripts/build.cmd
@@ -41,8 +41,8 @@ echo --------------------
%UserProfile%\.nuget\packages\nunit.consolerunner\3.6.1\tools\nunit3-console.exe src/Castle.Core.Tests.WeakNamed/bin/%Configuration%/net461/Castle.Core.Tests.WeakNamed.exe --result=DesktopClrWeakNamedTestResults.xml;format=nunit3 || exit /b 1
echo ---------------------------
-echo Running NETCOREAPP1.1 Tests
+echo Running NETCOREAPP3.1 Tests
echo ---------------------------
-dotnet .\src\Castle.Core.Tests\bin\%Configuration%\netcoreapp1.1\Castle.Core.Tests.dll --result=NetCoreClrTestResults.xml;format=nunit3 || exit /b 1
-dotnet .\src\Castle.Core.Tests.WeakNamed\bin\%Configuration%\netcoreapp1.1/Castle.Core.Tests.WeakNamed.dll --result=NetCoreClrWeakNamedTestResults.xml;format=nunit3 || exit /b 1
+dotnet .\src\Castle.Core.Tests\bin\%Configuration%\netcoreapp3.1\Castle.Core.Tests.dll --result=NetCoreClrTestResults.xml;format=nunit3 || exit /b 1
+dotnet .\src\Castle.Core.Tests.WeakNamed\bin\%Configuration%\netcoreapp3.1/Castle.Core.Tests.WeakNamed.dll --result=NetCoreClrWeakNamedTestResults.xml;format=nunit3 || exit /b 1
diff --git a/buildscripts/common.props b/buildscripts/common.props
index 6c9ba1b5c4..ab2100e275 100644
--- a/buildscripts/common.props
+++ b/buildscripts/common.props
@@ -1,5 +1,5 @@
-
+
$(NoWarn);CS1591;CS3014;CS3003;CS3001;CS3021
$(NoWarn);CS0612;CS0618
@@ -47,6 +47,8 @@
DEBUG
TRACE;FEATURE_NETCORE_REFLECTION_API;FEATURE_TEST_SERILOGINTEGRATION
$(NetStandard13Constants);FEATURE_CUSTOMMODIFIERS
+ TRACE;FEATURE_BINDINGLIST;FEATURE_DICTIONARYADAPTER_XML;FEATURE_CUSTOMMODIFIERS;FEATURE_GAC;FEATURE_IDATAERRORINFO;FEATURE_ISUPPORTINITIALIZE;FEATURE_LISTSORT;FEATURE_SMTP;FEATURE_TARGETEXCEPTION;FEATURE_TEST_DATASET;FEATURE_TEST_SERILOGINTEGRATION;FEATURE_NETSTANDARD2_COMPATIBILITY
+ TRACE;FEATURE_BINDINGLIST;FEATURE_DICTIONARYADAPTER_XML;FEATURE_CUSTOMMODIFIERS;FEATURE_GAC;FEATURE_IDATAERRORINFO;FEATURE_ISUPPORTINITIALIZE;FEATURE_LISTSORT;FEATURE_SMTP;FEATURE_TARGETEXCEPTION;FEATURE_TEST_DATASET;FEATURE_TEST_SERILOGINTEGRATION;FEATURE_NETSTANDARD2_COMPATIBILITY
TRACE;FEATURE_APPDOMAIN;FEATURE_ASSEMBLYBUILDER_SAVE;FEATURE_BINDINGLIST;FEATURE_DICTIONARYADAPTER_XML;FEATURE_CUSTOMMODIFIERS;FEATURE_EVENTLOG;FEATURE_GAC;FEATURE_GET_REFERENCED_ASSEMBLIES;FEATURE_IDATAERRORINFO;FEATURE_ISUPPORTINITIALIZE;FEATURE_LISTSORT;FEATURE_REMOTING;FEATURE_SECURITY_PERMISSIONS;FEATURE_SERIALIZATION;FEATURE_SMTP;FEATURE_SYSTEM_CONFIGURATION;FEATURE_TARGETEXCEPTION;FEATURE_TEST_COM;FEATURE_TEST_DATASET;FEATURE_TEST_SERILOGINTEGRATION
$(CommonDesktopClrConstants)
$(CommonDesktopClrConstants);FEATURE_TEST_PEVERIFY
@@ -92,6 +94,22 @@
$(NetStandard15Constants)
+
+ $(DiagnosticsConstants);$(NetStandard20Constants)
+
+
+
+ $(NetStandard20Constants)
+
+
+
+ $(DiagnosticsConstants);$(NetStandard21Constants)
+
+
+
+ $(NetStandard21Constants)
+
+
$(DiagnosticsConstants);$(NetStandard15Constants)
@@ -100,4 +118,20 @@
$(NetStandard15Constants)
+
+ $(DiagnosticsConstants);$(NetStandard20Constants)
+
+
+
+ $(NetStandard20Constants)
+
+
+
+ $(DiagnosticsConstants);$(NetStandard21Constants)
+
+
+
+ $(NetStandard21Constants)
+
+
diff --git a/ref/Castle.Core-netstandard2.0.cs b/ref/Castle.Core-netstandard2.0.cs
new file mode 100644
index 0000000000..b2b1ec6f5b
--- /dev/null
+++ b/ref/Castle.Core-netstandard2.0.cs
@@ -0,0 +1,3777 @@
+[assembly: System.CLSCompliantAttribute(true)]
+[assembly: System.Runtime.CompilerServices.InternalsVisibleToAttribute(@"Castle.Core.Tests, PublicKey=002400000480000094000000060200000024000052534131000400000100010077f5e87030dadccce6902c6adab7a987bd69cb5819991531f560785eacfc89b6fcddf6bb2a00743a7194e454c0273447fc6eec36474ba8e5a3823147d214298e4f9a631b1afee1a51ffeae4672d498f14b000e3d321453cdd8ac064de7e1cf4d222b7e81f54d4fd46725370d702a05b48738cc29d09228f1aa722ae1a9ca02fb")]
+[assembly: System.Runtime.InteropServices.ComVisibleAttribute(false)]
+[assembly: System.Runtime.Versioning.TargetFrameworkAttribute(".NETStandard,Version=v2.0", FrameworkDisplayName="")]
+namespace Castle.Components.DictionaryAdapter
+{
+ public abstract class AbstractDictionaryAdapter : System.Collections.ICollection, System.Collections.IDictionary, System.Collections.IEnumerable
+ {
+ protected AbstractDictionaryAdapter() { }
+ public int Count { get; }
+ public bool IsFixedSize { get; }
+ public abstract bool IsReadOnly { get; }
+ public virtual bool IsSynchronized { get; }
+ public abstract object this[object key] { get; set; }
+ public System.Collections.ICollection Keys { get; }
+ public virtual object SyncRoot { get; }
+ public System.Collections.ICollection Values { get; }
+ public void Add(object key, object value) { }
+ public void Clear() { }
+ public abstract bool Contains(object key);
+ public void CopyTo(System.Array array, int index) { }
+ public System.Collections.IDictionaryEnumerator GetEnumerator() { }
+ public void Remove(object key) { }
+ }
+ public abstract class AbstractDictionaryAdapterVisitor : Castle.Components.DictionaryAdapter.IDictionaryAdapterVisitor
+ {
+ protected AbstractDictionaryAdapterVisitor() { }
+ protected AbstractDictionaryAdapterVisitor(Castle.Components.DictionaryAdapter.AbstractDictionaryAdapterVisitor parent) { }
+ protected bool Cancelled { get; set; }
+ protected virtual void VisitCollection(Castle.Components.DictionaryAdapter.IDictionaryAdapter dictionaryAdapter, Castle.Components.DictionaryAdapter.PropertyDescriptor property, System.Type collectionItemType, object state) { }
+ public virtual bool VisitDictionaryAdapter(Castle.Components.DictionaryAdapter.IDictionaryAdapter dictionaryAdapter, object state) { }
+ public virtual bool VisitDictionaryAdapter(Castle.Components.DictionaryAdapter.IDictionaryAdapter dictionaryAdapter, System.Func selector, object state) { }
+ protected virtual void VisitInterface(Castle.Components.DictionaryAdapter.IDictionaryAdapter dictionaryAdapter, Castle.Components.DictionaryAdapter.PropertyDescriptor property, object state) { }
+ protected virtual void VisitProperty(Castle.Components.DictionaryAdapter.IDictionaryAdapter dictionaryAdapter, Castle.Components.DictionaryAdapter.PropertyDescriptor property, object state) { }
+ }
+ public class BindingListInitializer : Castle.Components.DictionaryAdapter.IValueInitializer
+ {
+ public BindingListInitializer(System.Func addAt, System.Func