Repository navigation
Commit ab00bf5
committed
Give each LoadAndInvokeMain compilation a unique assembly name
Every generator test project shares the same assembly name ('test',
from RoslynTestUtils.CreateTestProject), and LoadAndInvokeMain loads
into AssemblyLoadContext.Default, which never unloads. When more than
one theory case in this test run reaches LoadAndInvokeMain, the second
load collides with the first under the identical assembly identity
(FileLoadException: a different copy of assembly 'test.dll' is already
loaded). Rename the compilation to a fresh unique name right before
emitting so concurrent/sequential loads in the same process don't
collide.
Also note in a test comment that nested binding of this same shape is
tracked separately in #131399, filed per review
discussion on this PR.1 parent 16c022b commit ab00bf5
2 files changed
Lines changed: 10 additions & 0 deletions
File tree
- src/libraries/Microsoft.Extensions.Configuration.Binder/tests/SourceGenerationTests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
240 | 240 | | |
241 | 241 | | |
242 | 242 | | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
243 | 249 | | |
244 | 250 | | |
245 | 251 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
552 | 552 | | |
553 | 553 | | |
554 | 554 | | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
555 | 559 | | |
556 | 560 | | |
557 | 561 | | |
| |||
0 commit comments