DynamoVisualProgramming.DynamoServices by Autodesk

<PackageReference Include="DynamoVisualProgramming.DynamoServices" Version="3.5.0-beta7020" />

 KeepReferenceAttribute

This attribute indicates the parameter will be referenced by the return object, hence its DS wrap object shouldn't be disposed even it is out of scope. The life-cycle of parameter will have the same life-cycle as the return object. Note the type of return object should be reference type, either a pointer or an array.
using System; namespace Autodesk.DesignScript.Runtime { [AttributeUsage(AttributeTargets.Parameter)] public class KeepReferenceAttribute : Attribute { } }