Releases: castleproject/Core
Releases · castleproject/Core
5.2.0 (delayed)
Enhancements
- Two new generic method overloads
proxyGenerator.CreateClassProxy<TClass>([options], constructorArguments, interceptors)
(@backstromjoel, #636) - Allow specifying which attributes should always be copied to proxy class by adding attribute type to
AttributesToAlwaysReplicate
. Previously only non-inherited, withInherited=false
, attributes were copied. (@shoaibshakeel381, #633) - Support for C# 8+ default interface methods in interface and class proxies without target (@stakx, #661)
- DynamicProxy's public API has been augmented with nullable reference type annotations (@stakx, #668)
Bugfixes
ArgumentException
: "Could not find method overriding method" with overridden class method having generic by-ref parameter (@stakx, #657)ArgumentException
: "Cannot create an instance ofTEnum
becauseType.ContainsGenericParameters
is true" caused byEnum
constraint on methodout
parameter (@stakx, #658)
5.1.1
Bugfixes
- Proxies using records derived from a base generic record broken using .NET 6 compiler (@CesarD, #632)
- Failure proxying type that has a non-inheritable custom attribute type applied where
null
argument is given for array parameter (@stakx, #637) - Nested custom attribute types do not get replicated (@stakx, #638)
5.1.0
Enhancements
- Support for covariant method returns (@stakx, #619)
- Performance improvement with proxy type generation for class proxies (without target). Abstract class methods now reuse a predefined invocation type (like methods of interface proxies without target; see explanation below at version 5.0.0 enhancements) (@stakx, #626)
Bugfixes
5.0.0
Enhancements
- .NET 6.0 support (@Jevonius, #616)
- .NET Standard 2.0 and 2.1 support (@lg2de, #485)
- Non-intercepted methods on a class proxy with target are now forwarded to the target (@stakx, #571)
- Significant performance improvements with proxy type generation for interface proxies without target. Up until now, DynamicProxy generated a separate
IInvocation
implementation type for every single proxied method – it is now able to reuse a single predefined type in many cases, thereby reducing the total amount of dynamic type generation. (@stakx, #573)
Bugfixes
- Generic method with differently named generic arguments to parent throws
KeyNotFoundException
(@stakx, #106) - Proxying certain
[Serializable]
classes produces proxy types that fail PEVerify test (@stakx, #367) private protected
methods are not intercepted (@CrispyDrone, #535)System.UIntPtr
unsupported (@stakx, #546)- DynamicProxy generates two modules when proceeding from a class proxy's protected method to the target, causing an
InvalidOperationException
when saving the generated assembly to disk (@stakx, #569) - Upgrade log4net to v2.0.13 (@jonorossi, @stakx, @dschwartzni, #574, #605)
Deprecations
- Removed support for the .NET Framework < 4.6.2 and .NET Standard 1.x. (@stakx, #495, #496; @Jevonius, #614)
- Removed support for Code Access Security (CAS). (@stakx, #502)
- Removed support for Remoting. This library no longer defines any types deriving from
MarshalByRefObject
, andProxyUtil.IsProxy
(which used to recognize remoting/"transparent" proxies) now tests only for DynamicProxy proxies. (@stakx, #507) - The following public members have been removed:
Castle.Core.Internal.CollectionExtensions
(class)Castle.Core.Internal.Lock
(class) along with all related types and methodsCastle.Core.Internal.PermissionUtil.IsGranted
(method)Castle.Core.Pair<,>
(type). UseSystem.ValueTuple<,>
orSystem.Tuple<,>
instead.- all type members in
Castle.DynamicProxy.ModuleScope
that gave direct access to DynamicProxy's type cache andModuleBuilder
s. OnlySaveAssembly
,LoadAssemblyIntoCache
, and members supporting these two facilities are left public. - almost all types and type members in the
Castle.DynamicProxy.*
sub-namespaces, as most of them are intended for internal use only. - DynamicProxy's custom exception types have been replaced by standard BCL exceptions (where appropriate), and by a single
DynamicProxyException
type for internal DynamicProxy errors.
5.0.0-beta001
Full release notes will be available in the future.
4.4.1
Bugfixes
- Prevent method name collisions when a proxy type implements more than two identically named interfaces having one or more identically named methods each. Name collisions are avoided by including the declaring types' namespaces in the proxy type's method names. (@stakx, #469)
- Reduce lock contention while generating new proxy types which previously blocked new proxy instances (@tangdf, #484)
- Fix mixins where proxy constructor fields were ordered differently to interfaces because of different case comparisons (@zapov, #475)
- Fix proxy generation for types having only a
private protected
constructor (@mriehm, #491)
4.4.0
Enhancements
- Added trace logging level below Debug; maps to Trace in log4net/NLog, and Verbose in Serilog (@pi3k14, #404)
- Recognize read-only parameters by the
In
modreq (@zvirja, #406) - DictionaryAdapter: Exposed GetAdapter overloads with NameValueCollection parameter in .NET Standard (@rzontar, #423)
- Ability to add delegate mixins to proxies using
ProxyGenerationOptions.AddDelegate[Type]Mixin
. You can bind to the mixed-inInvoke
methods on the proxy usingProxyUtil.CreateDelegateToMixin
. (@stakx, #436) - New
IInvocation.CaptureProceedInfo()
method to enable better implementations of asynchronous interceptors (@stakx, #439)
Deprecations
- The API surrounding
Lock
has been deprecated. This consists of the members listed below. Consider using the Base Class Library'sSystem.Threading.ReaderWriterLockSlim
instead. (@stakx, #391)Castle.Core.Internal.Lock
(class)Castle.Core.Internal.ILockHolder
(interface)Castle.Core.Internal.IUpgradeableLockHolder
(interface)
- You should no longer manually emit types into DynamicProxy's dynamic assembly. For this reason, the following member has been deprecated. (@stakx, #445)
Castle.DynamicProxy.ModuleScope.DefineType
(method)
- The proxy type cache in
ModuleScope
should no longer be accessed directly. For this reason, the members listed below have been deprecated. (@stakx, #391)Castle.DynamicProxy.ModuleScope.Lock
(property)Castle.DynamicProxy.ModuleScope.GetFromCache
(method)Castle.DynamicProxy.ModuleScope.RegisterInCache
(method)Castle.DynamicProxy.Generators.BaseProxyGenerator.AddToCache
(method)Castle.DynamicProxy.Generators.BaseProxyGenerator.GetFromCache
(method)Castle.DynamicProxy.Generators.CacheKey
(class)Castle.DynamicProxy.Serialization.CacheMappingsAttribute.ApplyTo
(method)Castle.DynamicProxy.Serialization.CacheMappingsAttribute.GetDeserializedMappings
(method)
4.3.1
Enhancements
- Use shared read locking to reduce lock contention in InvocationHelper and ProxyUtil (@TimLovellSmith, #377)
Bugfixes
- Prevent interceptors from being able to modify
in
parameters (@stakx, #370) - Make default value replication of optional parameters more tolerant of default values that are represented in metadata with a mismatched type (@stakx, #371)
- Fix a concurrency issue (writing without taking a write lock first) in
BaseProxyGenerator.ObtainProxyType
(@stakx, #383)
Deprecations
4.3.0
Enhancements
- Added .NET Standard/.NET Core support for NLog (@snakefoot, #200)
- Added .NET Standard/.NET Core support for log4net (@snakefoot, #201)
- DynamicProxy supported C#
in
parameter modifiers only on the .NET Framework up until now. Adding .NET Standard 1.5 as an additional target to the NuGet package makes them work on .NET Core, too (@stakx, #339) - Replicate custom attributes on constructor parameters in the generated proxy type constructors to fulfill introspection of constructors. This does not change the proxying behavior. (@stakx, #341)
- Improve performance of InvocationHelper cache lookups (@tangdf, #358)
- Improve fidelity of default value replication of optional parameters to fulfill inspection of the generated proxies. This does not change the proxying behavior. (@stakx, #356)
- Improve cache performance of MethodFinder.GetAllInstanceMethods (@tangdf, #357)
Bugfixes
- Fix Castle.Services.Logging.Log4netIntegration assembly file name casing which breaks on Linux (@beginor, #324)
- Fix Castle.DynamicProxy.Generators.AttributesToAvoidReplicating not being thread safe (InvalidOperationException "Collection was modified; enumeration operation may not execute.") (@BrunoJuchli, #334)
- Fix TraceLoggerFactory to allow specifying the default logger level (@acjh, #342)
- Ensure that DynamicProxy doesn't create invalid dynamic assemblies when proxying types from non-strong-named assemblies (@stakx, #327)
- Fix interceptor selectors being passed
System.RuntimeType
for class proxies instead of the target type (@stakx, #359) - Replace NullReferenceException with descriptive one thrown when interceptors swallow exceptions and cause a null value type to be returned (@jonorossi, #85)