-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Description
Description
On .NET Framework we could set the System.Transactions.TransactionManager.DefaultTimeout from the config file as follows:
<system.transactions>
<defaultSettings timeout="00:05:00" />
</system.transactions>On .NET 6 (and presumably all previous versions of .NET and .NET Core), that configuration is not available. Attempting to use it results in this error:
ConfigurationErrorsException: Unrecognized configuration section system.transactions.
Since DefaultTimeout has no setter, that means there is no way of changing this setting other than reflection hacks. The documentation makes no mention of this.
This is similar to #1418 but not the same. That other issue relates to MaximumTimeout, not DefaultTimeout.
Reproduction Steps
- Add the timeout setting per the issue description
- Confirm that you get a runtime error
- Instead try to set the DefaultTimeout
- Confirm that you get a compile time error as there is no setter
Expected behavior
There should be some way of setting this (config setting, setter or other API) or the setting should be removed altogether.
Actual behavior
No way to change that setting so it is effectively hard coded to 00:01:00.
Regression?
Yes. It worked on .NET Framework.
Known Workarounds
Use reflection to set the value.
Configuration
- .NET 6
- Windows 10
- x64
- It is not specific to that configuration
- n/a
Other information
No response