Skip to content

Releases: castleproject/Core

5.1.0

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

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

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

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

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

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

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

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)

4.2.0

Compare
Choose a tag to compare

Enhancements

  • Add IProxyTargetAccessor.DynProxySetTarget to set the target of a proxy (@yallie, #293)
  • Internal dynamic proxy fields are now private instead of public (@spencercw, #260)

Bugfixes

  • Make ProxyUtil.IsAccessible(MethodBase) take into account declaring type's accessibility so it doesn't report false negatives for e.g. public methods in inaccessible classes. (@stakx, #289)
  • Fix InvalidCastException calling IChangeProxyTarget.ChangeProxyTarget proxying generic interfaces (@yallie, #293)
  • Ignore minor/patch level version for AssemblyVersionAttribute as this creates binding errors for downstream libraries (@fir3pho3nixx, #288)
  • Fix DictionaryAdapter firing NotifyPropertyChang(ed/ing) events after CancelEdit (@Lakritzator, #299)
  • Fix ArgumentException when overriding method with nested generics (@BitWizJason, #297)
  • Explicit package versioning applied within solution to avoid maligned NuGet upgrades for lock step versioned packages. (@fir3pho3nixx, #292)

Deprecations

  • IChangeProxyTarget.ChangeProxyTarget is deprecated in favor of IProxyTargetAccessor.DynProxySetTarget (@yallie, #293)

4.1.1

Compare
Choose a tag to compare

Bugfixes

  • Prevent member name collision when proxy implements same generic interface more than twice (@stakx, #88)
  • Fix incorrect replication (reversed order) of custom modifiers (modopts and modreqs) on the CLR, does not work yet on Mono (@stakx, #277)
  • Fix COM interface proxy error case throwing exceptions trying to release null pointer from QueryInterface (@stakx, #281)