{"record":{"id":"9aedba3cd1feb7b7","repo":"HangfireIO/Hangfire","slug":"property-type-fullname-transaction-not-found","errorCode":null,"errorMessage":"Property '{type.FullName}.Transaction' not found.","messagePattern":"Property '(.+?)\\.Transaction' not found\\.","errorType":"exception","errorClass":"MissingMemberException","httpStatus":null,"severity":"error","filePath":"src/Hangfire.SqlServer/SqlCommandSet.cs","lineNumber":89,"sourceCode":"                    }\n\n                    return type;\n                });\n\n                _setConnection = SetConnection.GetOrAdd(sqlCommandSetType, static type =>\n                {\n                    var p = Expression.Parameter(typeof(object));\n                    var converted = Expression.Convert(p, type);\n                    var connectionParameter = Expression.Parameter(typeof(DbConnection));\n                    var connectionProperty = type.GetProperty(\"Connection\", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic) ?? throw new MissingMemberException($\"Property '{type.FullName}.Connection' not found.\");\n                    return Expression.Lambda<Action<object, DbConnection>>(Expression.Assign(Expression.Property(converted, connectionProperty), Expression.Convert(connectionParameter, connectionProperty.PropertyType)), p, connectionParameter).Compile();\n                });\n                _setTransaction = SetTransaction.GetOrAdd(sqlCommandSetType, static type =>\n                {\n                    var p = Expression.Parameter(typeof(object));\n                    var converted = Expression.Convert(p, type);\n                    var transactionParameter = Expression.Parameter(typeof(DbTransaction));\n                    var transactionProperty = type.GetProperty(\"Transaction\", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic) ?? throw new MissingMemberException($\"Property '{type.FullName}.Transaction' not found.\");\n                    return Expression.Lambda<Action<object, DbTransaction>>(Expression.Assign(Expression.Property(converted, transactionProperty), Expression.Convert(transactionParameter, transactionProperty.PropertyType)), p, transactionParameter).Compile();\n                });\n                var batchCommandProperty = BatchCommandProperty.GetOrAdd(sqlCommandSetType, static type =>\n                {\n                    return type.GetProperty(\"BatchCommand\", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic) ?? throw new MissingMemberException($\"Property '{type.FullName}.BatchCommand' not found.\");\n                });\n                _getBatchCommand = GetBatchCommand.GetOrAdd(sqlCommandSetType, type =>\n                {\n                    var p = Expression.Parameter(typeof(object));\n                    var converted = Expression.Convert(p, type);\n                    return Expression.Lambda<Func<object, DbCommand>>(Expression.Property(converted, batchCommandProperty), p).Compile();\n                });\n                _appendMethod = AppendMethod.GetOrAdd(sqlCommandSetType, type =>\n                {\n                    var p = Expression.Parameter(typeof(object));\n                    var converted = Expression.Convert(p, type);\n                    var batchCommandParameter = Expression.Parameter(typeof(DbCommand));\n                    return Expression.Lambda<Action<object, DbCommand>>(Expression.Call(converted, \"Append\", null, Expression.Convert(batchCommandParameter, batchCommandProperty.PropertyType)), p, batchCommandParameter).Compile();","sourceCodeStart":71,"sourceCodeEnd":107,"githubUrl":"https://github.com/HangfireIO/Hangfire/blob/c236dd0f930f831ec151e436e138ddc429a02a72/src/Hangfire.SqlServer/SqlCommandSet.cs#L71-L107","documentation":"MissingMemberException thrown while compiling the setter for the Transaction property on SqlCommandSet: reflection found no Transaction property (public or non-public) on the resolved batch-command type. Same root cause family as the Connection/BatchCommand errors — the provider's internal surface changed.","triggerScenarios":"SqlClient assembly exposes a SqlCommandSet type but lacks a discoverable Transaction property; provider was trimmed, obfuscated, or is an incompatible version.","commonSituations":"Upgrading the SqlClient package without updating Hangfire.SqlServer; enabling IL trimming that removes 'unused' internal property metadata; mismatched provider major versions.","solutions":["Pin a SqlClient version documented as compatible with your Hangfire.SqlServer release.","Disable trimming/obfuscation for the SqlClient assembly, or publish untrimmed.","Upgrade Hangfire.SqlServer so its reflection targets match the provider's current layout."],"exampleFix":"// before (trimming enabled, removes internal property metadata)\n<PropertyGroup><PublishTrimmed>true</PublishTrimmed></PropertyGroup>\n\n// after\n<PropertyGroup><PublishTrimmed>false</PublishTrimmed></PropertyGroup>","handlingStrategy":"type-guard","validationCode":"static bool HasTransactionProperty(Type sqlCommandSetType)\n    => sqlCommandSetType.GetProperty(\"Transaction\",\n        BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic) != null;","typeGuard":"static bool IsSqlCommandSetUsable(Type type) =>\n    type.GetProperty(\"Transaction\", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic) != null;","tryCatchPattern":null,"preventionTips":["Disable PublishTrimmed for assemblies holding reflected internal members.","Match Hangfire.SqlServer and SqlClient major versions.","Run a smoke test that constructs SqlCommandSet against your production provider."],"tags":["sqlserver","reflection","provider","trimming"],"backgroundTag":null,"analyzedSha":"c236dd0f930f831ec151e436e138ddc429a02a72","analyzedAt":"2026-08-13T20:27:11.027Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}