Commit 8cdc34f
Fix DI scoping issue in RazorSourceGeneratorTestsBase
- Create scoped service provider instead of using root provider
- Update both RequestServices and ActivatorUtilities.CreateInstance to use scoped provider
- Properly dispose scope with using statement
This fixes test failures in environments with stricter DI validation and aligns with ASP.NET Core best practices.
Co-authored-by: davidwengier <[email protected]>1 parent c213261 commit 8cdc34f
File tree
1 file changed
+4
-2
lines changed- src/Compiler/test/Microsoft.NET.Sdk.Razor.SourceGenerators.Tests
1 file changed
+4
-2
lines changedLines changed: 4 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
150 | 150 | | |
151 | 151 | | |
152 | 152 | | |
| 153 | + | |
| 154 | + | |
153 | 155 | | |
154 | 156 | | |
155 | | - | |
| 157 | + | |
156 | 158 | | |
157 | 159 | | |
158 | 160 | | |
| |||
184 | 186 | | |
185 | 187 | | |
186 | 188 | | |
187 | | - | |
| 189 | + | |
188 | 190 | | |
189 | 191 | | |
190 | 192 | | |
| |||
0 commit comments