Skip to content

Commit 63b383e

Browse files
committed
fix: PR comments
1 parent efd8ca6 commit 63b383e

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
55

66
Prefix your items with `(Template)` if the change is about the template and not the resulting application.
77

8+
## 3.10.X
9+
- Added Dependency Injection validation in the development environment.
10+
811
## 3.9.X
912
- Removed unnecessary `IsExternalInit.cs` files.
1013
- Renamed multiple components from the data access layer to not all be named `Repository`.
@@ -16,7 +19,6 @@ Prefix your items with `(Template)` if the change is about the template and not
1619
- Optimized the .NET workloads install process.
1720
- Fixed the iOS application icon size.
1821
- Added VM Disposal in Functional Tests.
19-
- Added Dependency Injection validation in the development environment.
2022

2123
## 3.8.X
2224
- Updated from .NET 8 to .NET 9.

src/ApplicationTemplate.sln

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "root", "root", "{8711E408-6
1212
..\.editorconfig = ..\.editorconfig
1313
..\.gitignore = ..\.gitignore
1414
..\APP_README.md = ..\APP_README.md
15+
..\CHANGELOG.md = ..\CHANGELOG.md
1516
..\CODE_OF_CONDUCT.md = ..\CODE_OF_CONDUCT.md
1617
..\CONTRIBUTING.md = ..\CONTRIBUTING.md
1718
..\Directory.Build.props = ..\Directory.Build.props
@@ -24,7 +25,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "doc", "doc", "{4A31B4ED-94E
2425
ProjectSection(SolutionItems) = preProject
2526
..\doc\Architecture.md = ..\doc\Architecture.md
2627
..\doc\AzurePipelines.md = ..\doc\AzurePipelines.md
27-
..\CHANGELOG.md = ..\CHANGELOG.md
2828
..\doc\Configuration.md = ..\doc\Configuration.md
2929
..\doc\DataLoading.md = ..\doc\DataLoading.md
3030
..\doc\DefaultAnalytics.md = ..\doc\DefaultAnalytics.md

src/app/ApplicationTemplate.Presentation/Framework/Startup/CoreStartupBase.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,8 +183,17 @@ private IServiceProvider CreateHostServices(string contentRootPath, string setti
183183
{
184184
loggingConfiguration(hostBuilderContext, loggingBuilder, isAppLogging: false);
185185
})
186+
/* This code configures the default service provider for the host.
187+
* The service provider is responsible for dependency injection in the application.
188+
* The options.ValidateScopes and options.ValidateOnBuild properties are set based on the hosting environment.
189+
* If the application is in development mode, these properties are set to true to enable additional validation checks.
190+
* ValidateScopes ensures that scoped services are not resolved from the root provider, which can lead to unintended behavior.
191+
* ValidateOnBuild validates the service provider's configuration when it is built, ensuring all services can be created and there are no missing or circular dependencies.
192+
* In non-development mode, these validations are disabled to improve performance.
193+
*/
186194
.UseDefaultServiceProvider((context, options) =>
187195
{
196+
// Enable validation checks in development mode.
188197
options.ValidateScopes = context.HostingEnvironment.IsDevelopment();
189198
options.ValidateOnBuild = context.HostingEnvironment.IsDevelopment();
190199
})

0 commit comments

Comments
 (0)