Castle Core provides common Castle Project abstractions including logging services. It also features Castle DynamicProxy a lightweight runtime proxy generator, and Castle DictionaryAdapter.
See the documentation.
See the Releases.
Debugging symbols are available in symbol packages in the AppVeyor build artifacts since version 4.1.0. For example, here are the artifacts for 4.1.0.
Castle Core is © 2004-2019 Castle Project. It is free software, and may be redistributed under the terms of the Apache 2.0 license.
Browse the contributing section of our Home repository to get involved.
Platforms | Build Status | NuGet Feed |
---|---|---|
Windows & Linux | Preview Feed |
build.cmd
Compilation requires an up-to-date .NET Core SDK, MSBuild 15+ (which should be included in the former), and reference assemblies for the .NET Framework versions 3.5, 4.0, and 4.5.
Running the unit tests additionally requires the .NET Framework 4.6.1+ as well as the .NET Core 1.1 runtime to be installed.
Most of these requirements should be covered by Visual Studio 2017.
./build.sh
Compilation requires an up-to-date .NET Core SDK, as well as Mono for the .NET Framework reference assemblies. We recommend Mono 5.10+, though older versions (4.6.1+) might still work as well.
Running the unit tests additionally requires the .NET Core 1.1 runtime to be installed.
ℹ️ Mono runtime support: Castle Core runs with minor limitations and defects on Mono 4.0.2+ (however 4.6.1+ is highly recommended, or 5.10+ if your code uses new C# 7.x language features such as in
parameters).
We test against up-to-date Mono versions in order to fix known defects as soon as possible. Because of this, if you are using an older Mono version than our Continuous Integration (CI) build, you might see some unit tests fail.
For known Mono defects, check our issue tracker, as well as unit tests marked with [ExcludeOnFramework(Framework.Mono, ...)]
in the source code.
The following conditional compilation symbols (vertical) are currently defined for each of the build configurations (horizontal):
Symbol | NET35 | NET40 | NET45 | .NET Core |
---|---|---|---|---|
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_LEGACY_REFLECTION_API |
✅ | ✅ | 🚫 | 🚫 |
FEATURE_LISTSORT |
✅ | ✅ | ✅ | 🚫 |
FEATURE_NETCORE_REFLECTION_API |
🚫 | 🚫 | 🚫 | ✅ |
FEATURE_REMOTING |
✅ | ✅ | ✅ | 🚫 |
FEATURE_SECURITY_PERMISSIONS |
✅ | ✅ | ✅ | 🚫 |
FEATURE_SERIALIZATION |
✅ | ✅ | ✅ | 🚫 |
FEATURE_SMTP |
✅ | ✅ | ✅ | 🚫 |
FEATURE_SYSTEM_CONFIGURATION |
✅ | ✅ | ✅ | 🚫 |
FEATURE_TARGETEXCEPTION |
✅ | ✅ | ✅ | 🚫 |
FEATURE_TEST_COM |
✅ | ✅ | ✅ | 🚫 |
FEATURE_TEST_DATASET |
✅ | ✅ | ✅ | 🚫 |
FEATURE_TEST_PEVERIFY |
✅ | ✅ | ✅ | 🚫 |
FEATURE_TEST_SERILOGINTEGRATION |
🚫 | 🚫 | ✅ | ✅ |
--- | ||||
DOTNET35 |
✅ | 🚫 | 🚫 | 🚫 |
DOTNET40 |
🚫 | ✅ | ✅ | 🚫 |
DOTNET45 |
🚫 | 🚫 | ✅ | 🚫 |
FEATURE_APPDOMAIN
- enables support for features that make use of an AppDomain in the host.FEATURE_ASSEMBLYBUILDER_SAVE
- enabled support for saving the dynamically generated proxy assembly.FEATURE_BINDINGLIST
- enables support features that make use of System.ComponentModel.BindingList.FEATURE_DICTIONARYADAPTER_XML
- enable DictionaryAdapter Xml features.FEATURE_CUSTOMMODIFIERS
- enables reading and emitting optional and required custom modifiers defined on parameters including return parameters. It seems like a defect in corefx not to expose these methods because they are still implemented.FEATURE_EVENTLOG
- provides a diagnostics logger using the Windows Event Log.FEATURE_GAC
- enables support for obtaining assemblies using an assembly long form name.FEATURE_GET_REFERENCED_ASSEMBLIES
- enables code that takes advantage of System.Reflection.Assembly.GetReferencedAssemblies().FEATURE_IDATAERRORINFO
- enables code that depends on System.ComponentModel.IDataErrorInfo.FEATURE_ISUPPORTINITIALIZE
- enables support for features that make use of System.ComponentModel.ISupportInitialize.FEATURE_LEGACY_REFLECTION_API
- provides a shim for .NET 3.5/4.0 that emulates theTypeInfo
API available in .NET 4.5+ and .NET Core.FEATURE_LISTSORT
- enables support for features that make use of System.ComponentModel.ListSortDescription.FEATURE_NETCORE_REFLECTION_API
- provides shims to implement missing functionality in .NET Core that has no alternatives.FEATURE_REMOTING
- supports remoting on various types including inheriting from MarshalByRefObject.FEATURE_SECURITY_PERMISSIONS
- enables the use of CAS and Security[Critical|SafeCritical|Transparent].FEATURE_SERIALIZATION
- enables support for serialization of dynamic proxies and other types.FEATURE_SMTP
- provides the email sender abstraction and implementation.FEATURE_SYSTEM_CONFIGURATION
- enables features that use System.Configuration and the ConfigurationManager.FEATURE_TARGETEXCEPTION
- enabled catching aTargetException
.System.Reflection.TargetException
is implemented by .NET Core but not exposed by corefx.FEATURE_TEST_COM
- enables COM Interop tests.FEATURE_TEST_DATASET
- enables tests that involveSystem.Data.DataSet
s.FEATURE_TEST_PEVERIFY
- enables verification of dynamic assemblies using PEVerify during tests. (Only defined on Windows builds since Windows is currently the only platform where PEVerify is available.)FEATURE_TEST_SERILOGINTEGRATION
- enables Serilog integration tests.