Skip to content

Releases: castleproject/Core

5.2.0 (delayed)

30 Aug 20:41
Compare
Choose a tag to compare

⚠️ This release has not yet been published to NuGet due to an expired API token, which needs to be updated first.

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, with Inherited=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 of TEnum because Type.ContainsGenericParameters is true" caused by Enum constraint on method out parameter (@stakx, #658)

5.1.1

30 Dec 09:14
Compare
Choose a tag to compare

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

02 Aug 13:06
Compare
Choose a tag to compare

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

  • DynamicProxy emits invalid metadata for redeclared event (@stakx, #590)
  • Proxies using records with a base class broken using .NET 6 compiler (@ajcvickers, #601)
  • MissingMethodException when proxying interfaces containing sealed methods (@stakx, #621)

5.0.0

11 May 13:44
652a250
Compare
Choose a tag to compare

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, and ProxyUtil.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 methods
    • Castle.Core.Internal.PermissionUtil.IsGranted (method)
    • Castle.Core.Pair<,> (type). Use System.ValueTuple<,> or System.Tuple<,> instead.
    • all type members in Castle.DynamicProxy.ModuleScope that gave direct access to DynamicProxy's type cache and ModuleBuilders. Only SaveAssembly, 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

10 May 04:22
773ed6b
Compare
Choose a tag to compare
5.0.0-beta001 Pre-release
Pre-release

Full release notes will be available in the future.

4.4.1

06 May 11:01
e1c1e6f
Compare
Choose a tag to compare

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

05 Apr 01:48
f0626e2
Compare
Choose a tag to compare

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-in Invoke methods on the proxy using ProxyUtil.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's System.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

20 Jun 14:51
1ba6c89
Compare
Choose a tag to compare

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

  • Castle.DynamicProxy.Generators.Emitters.ArgumentsUtil.IsAnyByRef (@stakx, #370)

4.3.0

06 Jun 15:08
38acf78
Compare
Choose a tag to compare

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)

4.2.1

10 Oct 15:11
Compare
Choose a tag to compare

Bugfixes

  • Add missing equality checks in MethodSignatureComparer.EqualSignatureTypes to fix TypeLoadExceptions ("Method does not have an implementation") (@stakx, #310)
  • Add missing XML documentation files to NuGet packages (@Fir3pho3nixx, #312)