Commit aadd729
committed
fix: add UseTestServer() to HostBuilder configuration
The migration from WebHostBuilder to HostBuilder omitted the
.UseTestServer() call, causing the test host to create a real
Kestrel server instead of a TestServer. This resulted in an
InvalidCastException when GetTestServer() tried to cast
KestrelServerImpl to TestServer.
Added .UseTestServer() in both the StartupClass and Middleware
configuration paths.
Signed-off-by: Shashwat Sinha <shashwat.sinha2003@gmail.com>1 parent 3c65629 commit aadd729
1 file changed
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
| 92 | + | |
92 | 93 | | |
93 | 94 | | |
94 | 95 | | |
| |||
115 | 116 | | |
116 | 117 | | |
117 | 118 | | |
| 119 | + | |
118 | 120 | | |
119 | 121 | | |
120 | 122 | | |
| |||
0 commit comments