A change was made to fix IDE0032 on some parts of the
SimpleInjectorContainer class. However, the change that was made
missed the fact that there was a compiler directive in place that
changed the default value for the property. While in debug mode, it
defaulted to true, but in anything else, it defaulted to false.
Initially during testing, this didn't cause any problems, however, when
using Chocolatey Agent, it caused errors to occur during start up of
the service. This was due to the fact that in Chocolatey Agent some
additional IoC registrations are performed, but with the default value
now set to true, the Verify method on the container instance was being
called, which then prevents any additional registrations from being
allowed, which meant the Chocolatey Agent service couldn't be started.
Testing
Build this PR for Chocolatey CLI
Build hotfix branch for CLE
Build hotfix branch for Agent
Install all packages on a fresh VM
Check Chocolatey Agent log and make sure that the service starts correctly
Operating Systems Testing
N/A
Change Types Made
[x] Bug fix (non-breaking change).
[ ] Feature / Enhancement (non-breaking change).
[ ] Breaking change (fix or feature that could cause existing functionality to change).
Description Of Changes
This commit puts back in place the default values for the property, using the exisitng cmpilers directives.
Motivation and Context
In a previous commit:
https://github.com/chocolatey/choco/commit/8c422301e4589b879d866e710d1261abf0bdab4e#diff-56c83e4e3e69e032ca2de3fefe172645908c9db983ef1a9080cc3aa87ea5b773R45
A change was made to fix IDE0032 on some parts of the SimpleInjectorContainer class. However, the change that was made missed the fact that there was a compiler directive in place that changed the default value for the property. While in debug mode, it defaulted to true, but in anything else, it defaulted to false.
Initially during testing, this didn't cause any problems, however, when using Chocolatey Agent, it caused errors to occur during start up of the service. This was due to the fact that in Chocolatey Agent some additional IoC registrations are performed, but with the default value now set to true, the Verify method on the container instance was being called, which then prevents any additional registrations from being allowed, which meant the Chocolatey Agent service couldn't be started.
Testing
Operating Systems Testing
N/A
Change Types Made
Change Checklist
Related Issue
N/A - This is reverting a change that was done under a
maint
commit, and this commit is done under the samemaint
.