Castle Core, including Castle DynamicProxy, Logging Services and DictionaryAdapter
C# Other

README.md

Castle Core

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.

Releases

See the Releases.

License

Castle Core is © 2004-2016 Castle Project. It is free software, and may be redistributed under the terms of the Apache 2.0 license.

Building

.NET Framework and .NET Core

msbuild /p:Configuration=NET35-Release /t:RunAllTests buildscripts/Build.proj
msbuild /p:Configuration=NET40-Release /t:RunAllTests buildscripts/Build.proj
msbuild /p:Configuration=NET45-Release /t:RunAllTests buildscripts/Build.proj
build NETCORE

Mono

Castle Core works with some limitations and defects on Mono 4.0.2+, previous 4.x releases have serious runtime bugs that cause runtime crashes. Mono 3.x releases used to work well, but are not supported. Check our issue tracker for known Mono defects.

build MONO

Conditional Compilation Symbols

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_APTCA 🚫 🚫 🚫 🚫
FEATURE_ASSEMBLYBUILDER_SAVE 🚫
FEATURE_BINDINGLIST 🚫
FEATURE_DICTIONARYADAPTER_XML 🚫
FEATURE_EMIT_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_SERILOGINTEGRATION 🚫 🚫
---
DOTNET35 🚫 🚫 🚫
DOTNET40 🚫 🚫
DOTNET45 🚫 🚫 🚫
  • FEATURE_APPDOMAIN - enables support for features that make use of an AppDomain in the host.
  • FEATURE_APTCA - marks the assembly with the AllowPartiallyTrustedCallersAttribute.
  • 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_EMIT_CUSTOMMODIFIERS - enables 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 the TypeInfo 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 a TargetException. System.Reflection.TargetException is implemented by .NET Core but not exposed by corefx.
  • FEATURE_TEST_COM - enables COM Interop tests.
  • FEATURE_TEST_SERILOGINTEGRATION - enables Serilog intergration tests.

The __MonoCS__ symbol is used only in unit tests when compiled on Mono to work around Mono defects and limitations, however we are moving away from platform specific symbols as much as possible.