Skip to content

Commit 63d75a2

Browse files
author
Johnny Pham
authored
Merge pull request #1 from dotnet/master
a
2 parents 678565b + ffc6bd0 commit 63d75a2

File tree

65 files changed

+1992
-1235
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+1992
-1235
lines changed

.dockerignore

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
**/.classpath
2+
**/.dockerignore
3+
**/.env
4+
**/.git
5+
**/.gitignore
6+
**/.project
7+
**/.settings
8+
**/.toolstarget
9+
**/.vs
10+
**/.vscode
11+
**/*.*proj.user
12+
**/*.dbmdl
13+
**/*.jfm
14+
**/azds.yaml
15+
**/bin
16+
**/charts
17+
**/docker-compose*
18+
**/Dockerfile*
19+
**/node_modules
20+
**/npm-debug.log
21+
**/obj
22+
**/secrets.dev.yaml
23+
**/values.dev.yaml
24+
LICENSE
25+
README.md

BUILDGUIDE.md

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,10 +177,41 @@ Tests can be built and run with custom Target Frameworks. See the below examples
177177

178178
Managed SNI can be enabled on Windows by enabling the below AppContext switch:
179179

180-
**"Microsoft.Data.SqlClient.UseManagedNetworkingOnWindows"**
180+
**"Switch.Microsoft.Data.SqlClient.UseManagedNetworkingOnWindows"**
181181

182182
## Set truncation on for scaled decimal parameters
183183

184184
Scaled decimal parameter truncation can be enabled by enabling the below AppContext switch:
185185

186186
**"Switch.Microsoft.Data.SqlClient.TruncateScaledDecimal"**
187+
188+
## Debugging SqlClient on Linux from Windows
189+
190+
For enhanced developer experience, we support debugging SqlClient on Linux from Windows, using the project "**Microsoft.Data.SqlClient.DockerLinuxTest**" that requires "Container Tools" to be enabled in Visual Studio. You may import configuration: [VS19Components.vsconfig](./tools/vsconfig/VS19Components.vsconfig) if not enabled already.
191+
192+
This project is also included in `docker-compose.yml` to demonstrate connectivity with SQL Server docker image.
193+
194+
To run the same:
195+
1. Build the Solution in Visual Studio
196+
2. Set `docker-compose` as Startup Project
197+
3. Run "Docker-Compose" launch configuration.
198+
4. You will see similar message in Debug window:
199+
```log
200+
Connected to SQL Server v15.00.4023 from Unix 4.19.76.0
201+
The program 'dotnet' has exited with code 0 (0x0).
202+
```
203+
5. Now you can write code in [Program.cs](/src/Microsoft.Data.SqlClient/tests/DockerLinuxTest/Program.cs) to debug SqlClient on Linux!
204+
205+
### Troubleshooting Docker issues
206+
207+
There may be times where connection cannot be made to SQL Server, we found below ideas helpful:
208+
209+
- Clear Docker images to create clean image from time-to-time, and clear docker cache if needed by running `docker system prune` in Command Prompt.
210+
211+
- If you face `sni.dll not found` errors when debugging, try updating below properties in netcore\Microsoft.Data.SqlClient.csproj file and try again:
212+
```xml
213+
<OSGroup>Unix</OSGroup>
214+
<TargetsWindows>false</TargetsWindows>
215+
<TargetsUnix>true</TargetsUnix>
216+
```
217+
```

CHANGELOG.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,30 @@ All notable changes to this project will be documented in this file.
44

55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
66

7+
## [Preview Release 2.0.0-preview3.20122.2] - 2020-05-01
8+
9+
### Added
10+
- Allow passing username with Active Directory Interactive Authentication in .NET Framework [#492](https://github.com/dotnet/SqlClient/pull/492)
11+
- Allow large UDT buffers for .NET Framework [#456](https://github.com/dotnet/SqlClient/pull/456)
12+
- Added "Transaction Id" and "Client Version" in Diagnostic Source traces [#515](https://github.com/dotnet/SqlClient/pull/515)
13+
- Added new `SqlConnectionOverrides` APIs to perform `SqlConnection.Open()` with fail fast option [#463](https://github.com/dotnet/SqlClient/pull/463)
14+
15+
### Fixed
16+
- Addressed MARS TDS Header errors by reverting changes to make `SqlDataReader.ReadAsync()` non-blocking [#547](https://github.com/dotnet/SqlClient/pull/547)
17+
- Fixed driver behavior to not perform enlistment of pooled connection in aborted transaction [#543](https://github.com/dotnet/SqlClient/pull/543)
18+
- Fixed wrong application domain selected when starting `SqlDependencyListener` [#410](https://github.com/dotnet/SqlClient/pull/410)
19+
- Added missing refs for `RowCopied` property in `SqlBulkCopy` [#508](https://github.com/dotnet/SqlClient/pull/508)
20+
21+
### Changes
22+
- Improved performance by removing unwanted method calls in Event Source tracing [#506](https://github.com/dotnet/SqlClient/pull/506)
23+
- Removed Diagnostic Source and Configuration Manager dependencies from .NET Standard implementation [#535](https://github.com/dotnet/SqlClient/pull/535)
24+
- Removed redundant calls to `DbConnectionPoolKey.GetType()` [#512](https://github.com/dotnet/SqlClient/pull/512)
25+
26+
### Breaking Changes
27+
- Updated driver to perform decimal scale rounding to match SQL Server behavior [#470](https://github.com/dotnet/SqlClient/pull/470)
28+
- Standardized App Context switch name that enables Managed SNI on Windows for .NET Core and .NET Standard (break only applies to 2.0 preview releases that introduced the switch) [#548](https://github.com/dotnet/SqlClient/pull/548)
29+
30+
731
## [Stable Release 1.1.2] - 2020-04-15
832

933
### Added

doc/snippets/Microsoft.Data.SqlClient/SqlConnection.xml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -928,6 +928,46 @@ GO
928928
The <see langword="&lt;system.data.localdb&gt;" /> tag in the app.config file has invalid or unknown elements.</exception>
929929
<exception cref="T:System.Configuration.ConfigurationErrorsException">There are two entries with the same name in the <see langword="&lt;localdbinstances&gt;" /> section.</exception>
930930
</Open>
931+
<OpenWithOverrides>
932+
<param name="overrides">Options to override default connection open behavior.</param>
933+
<summary>
934+
Opens a database connection with the property settings specified by the <see cref="P:Microsoft.Data.SqlClient.SqlConnection.ConnectionString" />.
935+
</summary>
936+
<remarks>
937+
<format type="text/markdown">
938+
<![CDATA[
939+
940+
## Remarks
941+
The <xref:Microsoft.Data.SqlClient.SqlConnection> draws an open connection from the connection pool if one is available. Otherwise, it establishes a new connection to an instance of SQL Server. If overrides are specified, the first open attempt will apply the specified overrides to the open action.
942+
943+
> [!NOTE]
944+
> If the <xref:Microsoft.Data.SqlClient.SqlConnection> goes out of scope, it is not closed. Therefore, you must explicitly close the connection by calling <xref:Microsoft.Data.SqlClient.SqlConnection.Close%2A>.
945+
946+
> [!NOTE]
947+
> If you specify a port number other than 1433 when you are trying to connect to an instance of SQL Server and using a protocol other than TCP/IP, the <xref:Microsoft.Data.SqlClient.SqlConnection.Open%2A> method fails. To specify a port number other than 1433, include "server=machinename,port number" in the connection string, and use the TCP/IP protocol.
948+
949+
> [!NOTE]
950+
> The .NET Framework Data Provider for SQL Server requires the Security permission with "Allows calls to unmanaged assemblies" enabled (<xref:System.Security.Permissions.SecurityPermission> with <xref:System.Security.Permissions.SecurityPermissionFlag> set to `UnmanagedCode`) to open a <xref:Microsoft.Data.SqlClient.SqlConnection> with SQL Debugging enabled.
951+
952+
## Examples
953+
The following example creates a <xref:Microsoft.Data.SqlClient.SqlConnection>, opens it, and displays some of its properties. The connection is automatically closed at the end of the `using` block.
954+
955+
[!code-csharp[SqlConnection_Open Example#1](~/../sqlclient/doc/samples/SqlConnection_Open.cs#1)]
956+
957+
]]>
958+
</format>
959+
</remarks>
960+
<exception cref="T:System.InvalidOperationException">Cannot open a connection without specifying a data source or server.
961+
962+
or
963+
964+
The connection is already open.
965+
</exception>
966+
<exception cref="T:Microsoft.Data.SqlClient.SqlException">A connection-level error occurred while opening the connection. If the <see cref="P:Microsoft.Data.SqlClient.SqlException.Number" /> property contains the value 18487 or 18488, this indicates that the specified password has expired or must be reset. See the <see cref="M:Microsoft.Data.SqlClient.SqlConnection.ChangePassword(System.String,System.String)" /> method for more information.
967+
968+
The <see langword="&lt;system.data.localdb&gt;" /> tag in the app.config file has invalid or unknown elements.</exception>
969+
<exception cref="T:System.Configuration.ConfigurationErrorsException">There are two entries with the same name in the <see langword="&lt;localdbinstances&gt;" /> section.</exception>
970+
</OpenWithOverrides>
931971
<OpenAsync>
932972
<param name="cancellationToken">The cancellation instruction.</param>
933973
<summary>An asynchronous version of <see cref="M:Microsoft.Data.SqlClient.SqlConnection.Open" />, which opens a database connection with the property settings specified by the <see cref="P:Microsoft.Data.SqlClient.SqlConnection.ConnectionString" />. The cancellation token can be used to request that the operation be abandoned before the connection timeout elapses. Exceptions will be propagated via the returned Task. If the connection timeout time elapses without successfully connecting, the returned Task will be marked as faulted with an Exception. The implementation returns a Task without blocking the calling thread for both pooled and non-pooled connections.</summary>
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<docs>
2+
<members name="SqlConnectionOverrides">
3+
<SqlConnectionOverrides>
4+
<summary>
5+
Specifies a value for Overrides.
6+
</summary>
7+
</SqlConnectionOverrides>
8+
<None>
9+
<summary>No overrides.</summary>
10+
<value>0</value>
11+
</None>
12+
<OpenWithoutRetry>
13+
<summary>Disable transient fault handling during the initial SqlConnection Open attempt.</summary>
14+
<value>1</value>
15+
</OpenWithoutRetry>
16+
</members>
17+
</docs>
Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
# Release Notes
2+
3+
## Microsoft.Data.SqlClient 2.0.0-preview3.20122.2 released 1 May 2020
4+
5+
This update brings the below changes over the previous release:
6+
7+
### Added
8+
- Allow passing username with Active Directory Interactive Authentication in .NET Framework [#492](https://github.com/dotnet/SqlClient/pull/492)
9+
- Allow large UDT buffers for .NET Framework [#456](https://github.com/dotnet/SqlClient/pull/456)
10+
- Added "Transaction Id" and "Client Version" in Diagnostic Source traces [#515](https://github.com/dotnet/SqlClient/pull/515)
11+
- Added new `SqlConnectionOverrides` APIs to perform `SqlConnection.Open()` with fail fast option [#463](https://github.com/dotnet/SqlClient/pull/463)
12+
13+
### Fixed
14+
- Addressed MARS TDS Header errors by reverting changes to make `SqlDataReader.ReadAsync()` non-blocking [#547](https://github.com/dotnet/SqlClient/pull/547)
15+
- Fixed driver behavior to not perform enlistment of pooled connection in aborted transaction [#543](https://github.com/dotnet/SqlClient/pull/543)
16+
- Fixed wrong application domain selected when starting `SqlDependencyListener` [#410](https://github.com/dotnet/SqlClient/pull/410)
17+
- Added missing refs for `RowCopied` property in `SqlBulkCopy` [#508](https://github.com/dotnet/SqlClient/pull/508)
18+
19+
### Changes
20+
- Improved performance by removing unwanted method calls in Event Source tracing [#506](https://github.com/dotnet/SqlClient/pull/506)
21+
- Removed Diagnostic Source and Configuration Manager dependencies from .NET Standard implementation [#535](https://github.com/dotnet/SqlClient/pull/535)
22+
- Removed redundant calls to `DbConnectionPoolKey.GetType()` [#512](https://github.com/dotnet/SqlClient/pull/512)
23+
24+
### Breaking Changes
25+
- Updated driver to perform decimal scale rounding to match SQL Server behavior [#470](https://github.com/dotnet/SqlClient/pull/470)
26+
- Standardized App Context switch that enables Managed SNI on Windows for .NET Core and .NET Standard (break only applies to 2.0 preview releases that introduced the switch) [#548](https://github.com/dotnet/SqlClient/pull/548)
27+
28+
29+
### Enabling decimal truncation behavior conditionally
30+
Starting with v2.0.0-preview3, the decimal data scale will be rounded by the driver by default as is done by SQL Server.
31+
For backwards compatibility, you can set the [AppContext](https://docs.microsoft.com/en-us/dotnet/api/system.appcontext?view=netframework-4.8) switch "Switch.Microsoft.Data.SqlClient.TruncateScaledDecimal" to "true".
32+
33+
To set the switch at application startup, specify:
34+
35+
```cs
36+
AppContext.SetSwitch("Switch.Microsoft.Data.SqlClient.TruncateScaledDecimal", true);
37+
```
38+
39+
### Enabling Managed networking on Windows
40+
This release introduces the renamed AppContext switch "Switch.Microsoft.Data.SqlClient.UseManagedNetworkingOnWindows" that enables the use of Managed SNI instead of native SNI on Windows for testing and debugging purposes. This switch will toggle the driver's behavior to use Managed SNI in .NET Core 2.1+ and .NET Standard 2.0+ projects on Windows.
41+
42+
To set the switch at application startup, specify:
43+
44+
```cs
45+
AppContext.SetSwitch("Switch.Microsoft.Data.SqlClient.UseManagedNetworkingOnWindows", true);
46+
```
47+
48+
## Target Platform Support
49+
50+
- .NET Framework 4.6+
51+
- .NET Core 2.1+ (Windows x86, Windows x64, Linux, macOS)
52+
- .NET Standard 2.0+ (Windows x86, Windows x64, Linux, macOS)
53+
54+
### Dependencies
55+
56+
#### .NET Framework
57+
58+
- Microsoft.Data.SqlClient.SNI 1.1.0+
59+
- Microsoft.Identity.Client 3.0.8
60+
- Microsoft.IdentityModel.Protocols.OpenIdConnect 5.6.0
61+
- Microsoft.IdentityModel.JsonWebTokens 5.6.0
62+
63+
#### .NET Core 2.1
64+
65+
- runtime.native.System.Data.SqlClient.sni 4.4.0
66+
- Microsoft.Win32.Registry 4.7.0
67+
- System.Security.Principal.Windows 4.7.0
68+
- System.Text.Encoding.CodePages 4.7.0
69+
- System.Diagnostics.DiagnosticSource 4.7.0
70+
- System.Configuration.ConfigurationManager 4.7.0
71+
- System.Runtime.Caching 4.7.0
72+
- Microsoft.Identity.Client 4.7.1
73+
- Microsoft.IdentityModel.Protocols.OpenIdConnect 5.6.0
74+
- Microsoft.IdentityModel.JsonWebTokens 5.6.0
75+
76+
#### .NET Core 3.1
77+
78+
- runtime.native.System.Data.SqlClient.sni 4.4.0
79+
- Microsoft.Win32.Registry 4.7.0
80+
- System.Security.Principal.Windows 4.7.0
81+
- System.Text.Encoding.CodePages 4.7.0
82+
- System.Diagnostics.DiagnosticSource 4.7.0
83+
- System.Configuration.ConfigurationManager 4.7.0
84+
- System.Runtime.Caching 4.7.0
85+
- Microsoft.Identity.Client 4.7.1
86+
- Microsoft.IdentityModel.Protocols.OpenIdConnect 5.6.0
87+
- Microsoft.IdentityModel.JsonWebTokens 5.6.0
88+
89+
#### .NET Standard
90+
91+
- runtime.native.System.Data.SqlClient.sni 4.4.0
92+
- Microsoft.Win32.Registry 4.7.0
93+
- System.Buffers 4.5.0
94+
- System.Memory 4.5.3
95+
- System.Security.Principal.Windows 4.7.0
96+
- System.Text.Encoding.CodePages 4.7.0
97+
- Microsoft.Identity.Client 4.7.1
98+
- Microsoft.IdentityModel.Protocols.OpenIdConnect 5.6.0
99+
- Microsoft.IdentityModel.JsonWebTokens 5.6.0

release-notes/2.0/2.0.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ The following Microsoft.Data.SqlClient 2.0 preview releases have been shipped:
66
| :-- | :-- | :--: |
77
| 2020/01/21 | 2.0.0-preview1.20021.1 | [release notes](2.0.0-preview1.md) |
88
| 2020/03/24 | 2.0.0-preview2.20084.1 | [release notes](2.0.0-preview2.md) |
9+
| 2020/05/01 | 2.0.0-preview3.20122.2 | [release notes](2.0.0-preview3.md) |

release-notes/2.0/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ The following Microsoft.Data.SqlClient 2.0 preview releases have been shipped:
66
| :-- | :-- | :--: |
77
| 2020/01/21 | 2.0.0-preview1.20021.1 | [release notes](2.0.0-preview1.md) |
88
| 2020/03/24 | 2.0.0-preview2.20084.1 | [release notes](2.0.0-preview2.md) |
9+
| 2020/05/01 | 2.0.0-preview3.20122.2 | [release notes](2.0.0-preview3.md) |

src/.dockerignore

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
**/.classpath
2+
**/.dockerignore
3+
**/.env
4+
**/.git
5+
**/.gitignore
6+
**/.project
7+
**/.settings
8+
**/.toolstarget
9+
**/.vs
10+
**/.vscode
11+
**/*.*proj.user
12+
**/*.dbmdl
13+
**/*.jfm
14+
**/azds.yaml
15+
**/bin
16+
**/charts
17+
**/docker-compose*
18+
**/Dockerfile*
19+
**/node_modules
20+
**/npm-debug.log
21+
**/obj
22+
**/secrets.dev.yaml
23+
**/values.dev.yaml
24+
LICENSE
25+
README.md

0 commit comments

Comments
 (0)