Commit 59e4deb
fix: improve error message when Microsoft.SqlServer.Types assembly is missing
When a database uses geography, geometry, or hierarchyid columns and the
user has not referenced the Microsoft.SqlServer.Types NuGet package, the
previous error was a cryptic TypeLoadException that gave no hint about the
root cause.
This change catches the null result from Type.GetType (non-throwing overload)
and emits a clear message pointing to the missing NuGet package when the
type name contains 'Microsoft.SqlServer.Types'.
Closes #264
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent ceb4837 commit 59e4deb
1 file changed
Lines changed: 14 additions & 1 deletion
File tree
- src/SqlClient
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
146 | 146 | | |
147 | 147 | | |
148 | 148 | | |
149 | | - | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
150 | 163 | | |
151 | 164 | | |
152 | 165 | | |
| |||
0 commit comments