Skip to content

Commit e623b57

Browse files
saurabh500Ron Petrusha
authored andcommitted
Create 611802 - SQLConnection.ConnectionString throws NRE (microsoft#742)
* Rename 611802 - SQLConnection.ConnectionString throws NullReferenceException.md to 611802 - SQLConnection.ConnectionString throws NullReferenceException .md Documenting known issue for .Net Framework System.Data NRE. * Update 611802 - SQLConnection.ConnectionString throws NullReferenceException .md * Update 611802 - SQLConnection.ConnectionString throws NullReferenceException .md * Update 611802 - SQLConnection.ConnectionString throws NullReferenceException .md * Update 611802 - SQLConnection.ConnectionString throws NullReferenceException .md
1 parent 7a84af6 commit e623b57

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# NullReferenceException while setting `SqlConnection.ConnectionString` to an empty string or null.
2+
## Symptoms
3+
4+
When an application tries to set the `ConnectionString` property of the `SqlConnection` object to an empty string or null value, a `NullReferenceException` is thrown. This exception occurs when .NET Framework 4.7.2 is installed on the OS hosting the application.
5+
6+
7+
## Cause
8+
9+
.NET Framework 4.7.2 includes a change that increases the default connection retry count for connections to Azure SQL Database to two.
10+
This change sets the internal value of the retry count without validating if the `ConnectionString` is a non-null or non-empty value,
11+
which results in the `NullReferenceException`.
12+
13+
## Impact
14+
15+
The impact is limited to applications using the `SqlConnection.ConnectionString` API to set an empty connection string, which now throws an exception.
16+
17+
## Workarounds
18+
19+
No known workarounds with .NET Framework 4.7.2.
20+
21+
## Resolution
22+
23+
The .NET team is working on a fix that will be available in a future update.

0 commit comments

Comments
 (0)