Introduce Docker debugging with Docker Compose orchestration support (#471)

This commit is contained in:
Cheena Malhotra 2020-04-21 10:25:30 -07:00 коммит произвёл GitHub
Родитель 68eff11573
Коммит 5ceec82f1f
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
12 изменённых файлов: 440 добавлений и 24 удалений

25
.dockerignore Normal file
Просмотреть файл

@ -0,0 +1,25 @@
**/.classpath
**/.dockerignore
**/.env
**/.git
**/.gitignore
**/.project
**/.settings
**/.toolstarget
**/.vs
**/.vscode
**/*.*proj.user
**/*.dbmdl
**/*.jfm
**/azds.yaml
**/bin
**/charts
**/docker-compose*
**/Dockerfile*
**/node_modules
**/npm-debug.log
**/obj
**/secrets.dev.yaml
**/values.dev.yaml
LICENSE
README.md

Просмотреть файл

@ -184,3 +184,34 @@ Managed SNI can be enabled on Windows by enabling the below AppContext switch:
Scaled decimal parameter truncation can be enabled by enabling the below AppContext switch:
**"Switch.Microsoft.Data.SqlClient.TruncateScaledDecimal"**
## Debugging SqlClient on Linux from Windows
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.
This project is also included in `docker-compose.yml` to demonstrate connectivity with SQL Server docker image.
To run the same:
1. Build the Solution in Visual Studio
2. Set `docker-compose` as Startup Project
3. Run "Docker-Compose" launch configuration.
4. You will see similar message in Debug window:
```log
Connected to SQL Server v15.00.4023 from Unix 4.19.76.0
The program 'dotnet' has exited with code 0 (0x0).
```
5. Now you can write code in [Program.cs](/src/Microsoft.Data.SqlClient/tests/DockerLinuxTest/Program.cs) to debug SqlClient on Linux!
### Troubleshooting Docker issues
There may be times where connection cannot be made to SQL Server, we found below ideas helpful:
- 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.
- If you face `sni.dll not found` errors when debugging, try updating below properties in netcore\Microsoft.Data.SqlClient.csproj file and try again:
```xml
<OSGroup>Unix</OSGroup>
<TargetsWindows>false</TargetsWindows>
<TargetsUnix>true</TargetsUnix>
```
```

25
src/.dockerignore Normal file
Просмотреть файл

@ -0,0 +1,25 @@
**/.classpath
**/.dockerignore
**/.env
**/.git
**/.gitignore
**/.project
**/.settings
**/.toolstarget
**/.vs
**/.vscode
**/*.*proj.user
**/*.dbmdl
**/*.jfm
**/azds.yaml
**/bin
**/charts
**/docker-compose*
**/Dockerfile*
**/node_modules
**/npm-debug.log
**/obj
**/secrets.dev.yaml
**/values.dev.yaml
LICENSE
README.md

Просмотреть файл

@ -63,6 +63,114 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "add-ons", "add-ons", "{C972
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.DotNet.XUnitExtensions", "Microsoft.Data.SqlClient\tests\tools\Microsoft.DotNet.XUnitExtensions\Microsoft.DotNet.XUnitExtensions.csproj", "{FDA6971D-9F57-4DA4-B10A-261C91684CFC}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "doc", "doc", "{ED952CF7-84DF-437A-B066-F516E9BE1C2C}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "snippets", "snippets", "{71F356DC-DFA3-4163-8BFE-D268722CE189}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Microsoft.Data", "Microsoft.Data", "{908C7DD3-C999-40A6-9433-9F5ACA7C36F5}"
ProjectSection(SolutionItems) = preProject
..\doc\snippets\Microsoft.Data\OperationAbortedException.xml = ..\doc\snippets\Microsoft.Data\OperationAbortedException.xml
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Microsoft.Data.Sql", "Microsoft.Data.Sql", "{0CE216CE-8072-4985-B248-61F0D0BE9C2E}"
ProjectSection(SolutionItems) = preProject
..\doc\snippets\Microsoft.Data.Sql\SqlNotificationRequest.xml = ..\doc\snippets\Microsoft.Data.Sql\SqlNotificationRequest.xml
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Microsoft.Data.SqlClient", "Microsoft.Data.SqlClient", "{C05F4FFE-6A14-4409-AA0A-10630BE4F1EE}"
ProjectSection(SolutionItems) = preProject
..\doc\snippets\Microsoft.Data.SqlClient\ApplicationIntent.xml = ..\doc\snippets\Microsoft.Data.SqlClient\ApplicationIntent.xml
..\doc\snippets\Microsoft.Data.SqlClient\OnChangeEventHandler.xml = ..\doc\snippets\Microsoft.Data.SqlClient\OnChangeEventHandler.xml
..\doc\snippets\Microsoft.Data.SqlClient\PoolBlockingPeriod.xml = ..\doc\snippets\Microsoft.Data.SqlClient\PoolBlockingPeriod.xml
..\doc\snippets\Microsoft.Data.SqlClient\SortOrder.xml = ..\doc\snippets\Microsoft.Data.SqlClient\SortOrder.xml
..\doc\snippets\Microsoft.Data.SqlClient\SqlAuthenticationInitializer.xml = ..\doc\snippets\Microsoft.Data.SqlClient\SqlAuthenticationInitializer.xml
..\doc\snippets\Microsoft.Data.SqlClient\SqlAuthenticationMethod.xml = ..\doc\snippets\Microsoft.Data.SqlClient\SqlAuthenticationMethod.xml
..\doc\snippets\Microsoft.Data.SqlClient\SqlAuthenticationParameters.xml = ..\doc\snippets\Microsoft.Data.SqlClient\SqlAuthenticationParameters.xml
..\doc\snippets\Microsoft.Data.SqlClient\SqlAuthenticationProvider.xml = ..\doc\snippets\Microsoft.Data.SqlClient\SqlAuthenticationProvider.xml
..\doc\snippets\Microsoft.Data.SqlClient\SqlAuthenticationToken.xml = ..\doc\snippets\Microsoft.Data.SqlClient\SqlAuthenticationToken.xml
..\doc\snippets\Microsoft.Data.SqlClient\SqlBulkCopy.xml = ..\doc\snippets\Microsoft.Data.SqlClient\SqlBulkCopy.xml
..\doc\snippets\Microsoft.Data.SqlClient\SqlBulkCopyColumnMapping.xml = ..\doc\snippets\Microsoft.Data.SqlClient\SqlBulkCopyColumnMapping.xml
..\doc\snippets\Microsoft.Data.SqlClient\SqlBulkCopyColumnMappingCollection.xml = ..\doc\snippets\Microsoft.Data.SqlClient\SqlBulkCopyColumnMappingCollection.xml
..\doc\snippets\Microsoft.Data.SqlClient\SqlBulkCopyOptions.xml = ..\doc\snippets\Microsoft.Data.SqlClient\SqlBulkCopyOptions.xml
..\doc\snippets\Microsoft.Data.SqlClient\SqlClientFactory.xml = ..\doc\snippets\Microsoft.Data.SqlClient\SqlClientFactory.xml
..\doc\snippets\Microsoft.Data.SqlClient\SqlClientLogger.xml = ..\doc\snippets\Microsoft.Data.SqlClient\SqlClientLogger.xml
..\doc\snippets\Microsoft.Data.SqlClient\SqlClientMetaDataCollectionNames.xml = ..\doc\snippets\Microsoft.Data.SqlClient\SqlClientMetaDataCollectionNames.xml
..\doc\snippets\Microsoft.Data.SqlClient\SqlClientPermission.xml = ..\doc\snippets\Microsoft.Data.SqlClient\SqlClientPermission.xml
..\doc\snippets\Microsoft.Data.SqlClient\SqlClientPermissionAttribute.xml = ..\doc\snippets\Microsoft.Data.SqlClient\SqlClientPermissionAttribute.xml
..\doc\snippets\Microsoft.Data.SqlClient\SqlColumnEncryptionCertificateStoreProvider.xml = ..\doc\snippets\Microsoft.Data.SqlClient\SqlColumnEncryptionCertificateStoreProvider.xml
..\doc\snippets\Microsoft.Data.SqlClient\SqlColumnEncryptionCngProvider.xml = ..\doc\snippets\Microsoft.Data.SqlClient\SqlColumnEncryptionCngProvider.xml
..\doc\snippets\Microsoft.Data.SqlClient\SqlColumnEncryptionCspProvider.xml = ..\doc\snippets\Microsoft.Data.SqlClient\SqlColumnEncryptionCspProvider.xml
..\doc\snippets\Microsoft.Data.SqlClient\SqlColumnEncryptionEnclaveProvider.xml = ..\doc\snippets\Microsoft.Data.SqlClient\SqlColumnEncryptionEnclaveProvider.xml
..\doc\snippets\Microsoft.Data.SqlClient\SqlColumnEncryptionKeyStoreProvider.xml = ..\doc\snippets\Microsoft.Data.SqlClient\SqlColumnEncryptionKeyStoreProvider.xml
..\doc\snippets\Microsoft.Data.SqlClient\SqlCommand.xml = ..\doc\snippets\Microsoft.Data.SqlClient\SqlCommand.xml
..\doc\snippets\Microsoft.Data.SqlClient\SqlCommandBuilder.xml = ..\doc\snippets\Microsoft.Data.SqlClient\SqlCommandBuilder.xml
..\doc\snippets\Microsoft.Data.SqlClient\SqlCommandColumnEncryptionSetting.xml = ..\doc\snippets\Microsoft.Data.SqlClient\SqlCommandColumnEncryptionSetting.xml
..\doc\snippets\Microsoft.Data.SqlClient\SqlConnection.xml = ..\doc\snippets\Microsoft.Data.SqlClient\SqlConnection.xml
..\doc\snippets\Microsoft.Data.SqlClient\SqlConnectionAttestationProtocol.xml = ..\doc\snippets\Microsoft.Data.SqlClient\SqlConnectionAttestationProtocol.xml
..\doc\snippets\Microsoft.Data.SqlClient\SqlConnectionColumnEncryptionSetting.xml = ..\doc\snippets\Microsoft.Data.SqlClient\SqlConnectionColumnEncryptionSetting.xml
..\doc\snippets\Microsoft.Data.SqlClient\SqlConnectionStringBuilder.xml = ..\doc\snippets\Microsoft.Data.SqlClient\SqlConnectionStringBuilder.xml
..\doc\snippets\Microsoft.Data.SqlClient\SqlCredential.xml = ..\doc\snippets\Microsoft.Data.SqlClient\SqlCredential.xml
..\doc\snippets\Microsoft.Data.SqlClient\SqlDataAdapter.xml = ..\doc\snippets\Microsoft.Data.SqlClient\SqlDataAdapter.xml
..\doc\snippets\Microsoft.Data.SqlClient\SqlDataReader.xml = ..\doc\snippets\Microsoft.Data.SqlClient\SqlDataReader.xml
..\doc\snippets\Microsoft.Data.SqlClient\SQLDebugging.xml = ..\doc\snippets\Microsoft.Data.SqlClient\SQLDebugging.xml
..\doc\snippets\Microsoft.Data.SqlClient\SqlDependency.xml = ..\doc\snippets\Microsoft.Data.SqlClient\SqlDependency.xml
..\doc\snippets\Microsoft.Data.SqlClient\SqlEnclaveAttestationParameters.xml = ..\doc\snippets\Microsoft.Data.SqlClient\SqlEnclaveAttestationParameters.xml
..\doc\snippets\Microsoft.Data.SqlClient\SqlEnclaveSession.xml = ..\doc\snippets\Microsoft.Data.SqlClient\SqlEnclaveSession.xml
..\doc\snippets\Microsoft.Data.SqlClient\SqlError.xml = ..\doc\snippets\Microsoft.Data.SqlClient\SqlError.xml
..\doc\snippets\Microsoft.Data.SqlClient\SqlErrorCollection.xml = ..\doc\snippets\Microsoft.Data.SqlClient\SqlErrorCollection.xml
..\doc\snippets\Microsoft.Data.SqlClient\SqlException.xml = ..\doc\snippets\Microsoft.Data.SqlClient\SqlException.xml
..\doc\snippets\Microsoft.Data.SqlClient\SqlInfoMessageEventArgs.xml = ..\doc\snippets\Microsoft.Data.SqlClient\SqlInfoMessageEventArgs.xml
..\doc\snippets\Microsoft.Data.SqlClient\SqlInfoMessageEventHandler.xml = ..\doc\snippets\Microsoft.Data.SqlClient\SqlInfoMessageEventHandler.xml
..\doc\snippets\Microsoft.Data.SqlClient\SqlNotificationEventArgs.xml = ..\doc\snippets\Microsoft.Data.SqlClient\SqlNotificationEventArgs.xml
..\doc\snippets\Microsoft.Data.SqlClient\SqlNotificationInfo.xml = ..\doc\snippets\Microsoft.Data.SqlClient\SqlNotificationInfo.xml
..\doc\snippets\Microsoft.Data.SqlClient\SqlNotificationSource.xml = ..\doc\snippets\Microsoft.Data.SqlClient\SqlNotificationSource.xml
..\doc\snippets\Microsoft.Data.SqlClient\SqlNotificationType.xml = ..\doc\snippets\Microsoft.Data.SqlClient\SqlNotificationType.xml
..\doc\snippets\Microsoft.Data.SqlClient\SqlParameter.xml = ..\doc\snippets\Microsoft.Data.SqlClient\SqlParameter.xml
..\doc\snippets\Microsoft.Data.SqlClient\SqlParameterCollection.xml = ..\doc\snippets\Microsoft.Data.SqlClient\SqlParameterCollection.xml
..\doc\snippets\Microsoft.Data.SqlClient\SqlRowsCopiedEventArgs.xml = ..\doc\snippets\Microsoft.Data.SqlClient\SqlRowsCopiedEventArgs.xml
..\doc\snippets\Microsoft.Data.SqlClient\SqlRowsCopiedEventHandler.xml = ..\doc\snippets\Microsoft.Data.SqlClient\SqlRowsCopiedEventHandler.xml
..\doc\snippets\Microsoft.Data.SqlClient\SqlRowUpdatedEventArgs.xml = ..\doc\snippets\Microsoft.Data.SqlClient\SqlRowUpdatedEventArgs.xml
..\doc\snippets\Microsoft.Data.SqlClient\SqlRowUpdatedEventHandler.xml = ..\doc\snippets\Microsoft.Data.SqlClient\SqlRowUpdatedEventHandler.xml
..\doc\snippets\Microsoft.Data.SqlClient\SqlRowUpdatingEventArgs.xml = ..\doc\snippets\Microsoft.Data.SqlClient\SqlRowUpdatingEventArgs.xml
..\doc\snippets\Microsoft.Data.SqlClient\SqlRowUpdatingEventHandler.xml = ..\doc\snippets\Microsoft.Data.SqlClient\SqlRowUpdatingEventHandler.xml
..\doc\snippets\Microsoft.Data.SqlClient\SqlTransaction.xml = ..\doc\snippets\Microsoft.Data.SqlClient\SqlTransaction.xml
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Microsoft.Data.SqlClient.DataClassification", "Microsoft.Data.SqlClient.DataClassification", "{5D1F0032-7B0D-4FB6-A969-FCFB25C9EA1D}"
ProjectSection(SolutionItems) = preProject
..\doc\snippets\Microsoft.Data.SqlClient.DataClassification\ColumnSensitivity.xml = ..\doc\snippets\Microsoft.Data.SqlClient.DataClassification\ColumnSensitivity.xml
..\doc\snippets\Microsoft.Data.SqlClient.DataClassification\InformationType.xml = ..\doc\snippets\Microsoft.Data.SqlClient.DataClassification\InformationType.xml
..\doc\snippets\Microsoft.Data.SqlClient.DataClassification\Label.xml = ..\doc\snippets\Microsoft.Data.SqlClient.DataClassification\Label.xml
..\doc\snippets\Microsoft.Data.SqlClient.DataClassification\SensitivityClassification.xml = ..\doc\snippets\Microsoft.Data.SqlClient.DataClassification\SensitivityClassification.xml
..\doc\snippets\Microsoft.Data.SqlClient.DataClassification\SensitivityProperty.xml = ..\doc\snippets\Microsoft.Data.SqlClient.DataClassification\SensitivityProperty.xml
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Microsoft.Data.SqlClient.Server", "Microsoft.Data.SqlClient.Server", "{650EB7FA-EB0D-4F8E-AB2C-161C3AD8E363}"
ProjectSection(SolutionItems) = preProject
..\doc\snippets\Microsoft.Data.SqlClient.Server\DataAccessKind.xml = ..\doc\snippets\Microsoft.Data.SqlClient.Server\DataAccessKind.xml
..\doc\snippets\Microsoft.Data.SqlClient.Server\Format.xml = ..\doc\snippets\Microsoft.Data.SqlClient.Server\Format.xml
..\doc\snippets\Microsoft.Data.SqlClient.Server\IBinarySerialize.xml = ..\doc\snippets\Microsoft.Data.SqlClient.Server\IBinarySerialize.xml
..\doc\snippets\Microsoft.Data.SqlClient.Server\InvalidUdtException.xml = ..\doc\snippets\Microsoft.Data.SqlClient.Server\InvalidUdtException.xml
..\doc\snippets\Microsoft.Data.SqlClient.Server\SqlDataRecord.xml = ..\doc\snippets\Microsoft.Data.SqlClient.Server\SqlDataRecord.xml
..\doc\snippets\Microsoft.Data.SqlClient.Server\SqlFacetAttribute.xml = ..\doc\snippets\Microsoft.Data.SqlClient.Server\SqlFacetAttribute.xml
..\doc\snippets\Microsoft.Data.SqlClient.Server\SqlFunctionAttribute.xml = ..\doc\snippets\Microsoft.Data.SqlClient.Server\SqlFunctionAttribute.xml
..\doc\snippets\Microsoft.Data.SqlClient.Server\SqlMetaData.xml = ..\doc\snippets\Microsoft.Data.SqlClient.Server\SqlMetaData.xml
..\doc\snippets\Microsoft.Data.SqlClient.Server\SqlMethodAttribute.xml = ..\doc\snippets\Microsoft.Data.SqlClient.Server\SqlMethodAttribute.xml
..\doc\snippets\Microsoft.Data.SqlClient.Server\SqlUserDefinedAggregateAttribute.xml = ..\doc\snippets\Microsoft.Data.SqlClient.Server\SqlUserDefinedAggregateAttribute.xml
..\doc\snippets\Microsoft.Data.SqlClient.Server\SqlUserDefinedTypeAttribute.xml = ..\doc\snippets\Microsoft.Data.SqlClient.Server\SqlUserDefinedTypeAttribute.xml
..\doc\snippets\Microsoft.Data.SqlClient.Server\SystemDataAccessKind.xml = ..\doc\snippets\Microsoft.Data.SqlClient.Server\SystemDataAccessKind.xml
..\doc\snippets\Microsoft.Data.SqlClient.Server\TriggerAction.xml = ..\doc\snippets\Microsoft.Data.SqlClient.Server\TriggerAction.xml
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Microsoft.Data.SqlTypes", "Microsoft.Data.SqlTypes", "{5A7600BD-AED8-44AB-8F2A-7CB33A8D9C02}"
ProjectSection(SolutionItems) = preProject
..\doc\snippets\Microsoft.Data.SqlTypes\SqlFileStream.xml = ..\doc\snippets\Microsoft.Data.SqlTypes\SqlFileStream.xml
EndProjectSection
EndProject
Project("{E53339B2-1760-4266-BCC7-CA923CBCF16C}") = "docker-compose", "docker-compose.dcproj", "{F5DF2FDC-C860-4CB3-8B24-7C903C6FC076}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Data.SqlClient.DockerLinuxTest", "Microsoft.Data.SqlClient\tests\DockerLinuxTest\Microsoft.Data.SqlClient.DockerLinuxTest.csproj", "{833157E1-1E53-4908-B4CB-5C5507A44582}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -831,6 +939,102 @@ Global
{FDA6971D-9F57-4DA4-B10A-261C91684CFC}.Release|x64.Build.0 = Release|Any CPU
{FDA6971D-9F57-4DA4-B10A-261C91684CFC}.Release|x86.ActiveCfg = Release|Any CPU
{FDA6971D-9F57-4DA4-B10A-261C91684CFC}.Release|x86.Build.0 = Release|Any CPU
{F5DF2FDC-C860-4CB3-8B24-7C903C6FC076}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F5DF2FDC-C860-4CB3-8B24-7C903C6FC076}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F5DF2FDC-C860-4CB3-8B24-7C903C6FC076}.Debug|x64.ActiveCfg = Debug|Any CPU
{F5DF2FDC-C860-4CB3-8B24-7C903C6FC076}.Debug|x64.Build.0 = Debug|Any CPU
{F5DF2FDC-C860-4CB3-8B24-7C903C6FC076}.Debug|x86.ActiveCfg = Debug|Any CPU
{F5DF2FDC-C860-4CB3-8B24-7C903C6FC076}.Debug|x86.Build.0 = Debug|Any CPU
{F5DF2FDC-C860-4CB3-8B24-7C903C6FC076}.net46-Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F5DF2FDC-C860-4CB3-8B24-7C903C6FC076}.net46-Debug|Any CPU.Build.0 = Debug|Any CPU
{F5DF2FDC-C860-4CB3-8B24-7C903C6FC076}.net46-Debug|x64.ActiveCfg = Debug|Any CPU
{F5DF2FDC-C860-4CB3-8B24-7C903C6FC076}.net46-Debug|x64.Build.0 = Debug|Any CPU
{F5DF2FDC-C860-4CB3-8B24-7C903C6FC076}.net46-Debug|x86.ActiveCfg = Debug|Any CPU
{F5DF2FDC-C860-4CB3-8B24-7C903C6FC076}.net46-Debug|x86.Build.0 = Debug|Any CPU
{F5DF2FDC-C860-4CB3-8B24-7C903C6FC076}.net46-Release|Any CPU.ActiveCfg = Release|Any CPU
{F5DF2FDC-C860-4CB3-8B24-7C903C6FC076}.net46-Release|Any CPU.Build.0 = Release|Any CPU
{F5DF2FDC-C860-4CB3-8B24-7C903C6FC076}.net46-Release|x64.ActiveCfg = Release|Any CPU
{F5DF2FDC-C860-4CB3-8B24-7C903C6FC076}.net46-Release|x64.Build.0 = Release|Any CPU
{F5DF2FDC-C860-4CB3-8B24-7C903C6FC076}.net46-Release|x86.ActiveCfg = Release|Any CPU
{F5DF2FDC-C860-4CB3-8B24-7C903C6FC076}.net46-Release|x86.Build.0 = Release|Any CPU
{F5DF2FDC-C860-4CB3-8B24-7C903C6FC076}.netcoreapp2.1-Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F5DF2FDC-C860-4CB3-8B24-7C903C6FC076}.netcoreapp2.1-Debug|Any CPU.Build.0 = Debug|Any CPU
{F5DF2FDC-C860-4CB3-8B24-7C903C6FC076}.netcoreapp2.1-Debug|x64.ActiveCfg = Debug|Any CPU
{F5DF2FDC-C860-4CB3-8B24-7C903C6FC076}.netcoreapp2.1-Debug|x64.Build.0 = Debug|Any CPU
{F5DF2FDC-C860-4CB3-8B24-7C903C6FC076}.netcoreapp2.1-Debug|x86.ActiveCfg = Debug|Any CPU
{F5DF2FDC-C860-4CB3-8B24-7C903C6FC076}.netcoreapp2.1-Debug|x86.Build.0 = Debug|Any CPU
{F5DF2FDC-C860-4CB3-8B24-7C903C6FC076}.netcoreapp2.1-Release|Any CPU.ActiveCfg = Release|Any CPU
{F5DF2FDC-C860-4CB3-8B24-7C903C6FC076}.netcoreapp2.1-Release|Any CPU.Build.0 = Release|Any CPU
{F5DF2FDC-C860-4CB3-8B24-7C903C6FC076}.netcoreapp2.1-Release|x64.ActiveCfg = Release|Any CPU
{F5DF2FDC-C860-4CB3-8B24-7C903C6FC076}.netcoreapp2.1-Release|x64.Build.0 = Release|Any CPU
{F5DF2FDC-C860-4CB3-8B24-7C903C6FC076}.netcoreapp2.1-Release|x86.ActiveCfg = Release|Any CPU
{F5DF2FDC-C860-4CB3-8B24-7C903C6FC076}.netcoreapp2.1-Release|x86.Build.0 = Release|Any CPU
{F5DF2FDC-C860-4CB3-8B24-7C903C6FC076}.netcoreapp3.1-Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F5DF2FDC-C860-4CB3-8B24-7C903C6FC076}.netcoreapp3.1-Debug|Any CPU.Build.0 = Debug|Any CPU
{F5DF2FDC-C860-4CB3-8B24-7C903C6FC076}.netcoreapp3.1-Debug|x64.ActiveCfg = Debug|Any CPU
{F5DF2FDC-C860-4CB3-8B24-7C903C6FC076}.netcoreapp3.1-Debug|x64.Build.0 = Debug|Any CPU
{F5DF2FDC-C860-4CB3-8B24-7C903C6FC076}.netcoreapp3.1-Debug|x86.ActiveCfg = Debug|Any CPU
{F5DF2FDC-C860-4CB3-8B24-7C903C6FC076}.netcoreapp3.1-Debug|x86.Build.0 = Debug|Any CPU
{F5DF2FDC-C860-4CB3-8B24-7C903C6FC076}.netcoreapp3.1-Release|Any CPU.ActiveCfg = Release|Any CPU
{F5DF2FDC-C860-4CB3-8B24-7C903C6FC076}.netcoreapp3.1-Release|Any CPU.Build.0 = Release|Any CPU
{F5DF2FDC-C860-4CB3-8B24-7C903C6FC076}.netcoreapp3.1-Release|x64.ActiveCfg = Release|Any CPU
{F5DF2FDC-C860-4CB3-8B24-7C903C6FC076}.netcoreapp3.1-Release|x64.Build.0 = Release|Any CPU
{F5DF2FDC-C860-4CB3-8B24-7C903C6FC076}.netcoreapp3.1-Release|x86.ActiveCfg = Release|Any CPU
{F5DF2FDC-C860-4CB3-8B24-7C903C6FC076}.netcoreapp3.1-Release|x86.Build.0 = Release|Any CPU
{F5DF2FDC-C860-4CB3-8B24-7C903C6FC076}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F5DF2FDC-C860-4CB3-8B24-7C903C6FC076}.Release|Any CPU.Build.0 = Release|Any CPU
{F5DF2FDC-C860-4CB3-8B24-7C903C6FC076}.Release|x64.ActiveCfg = Release|Any CPU
{F5DF2FDC-C860-4CB3-8B24-7C903C6FC076}.Release|x64.Build.0 = Release|Any CPU
{F5DF2FDC-C860-4CB3-8B24-7C903C6FC076}.Release|x86.ActiveCfg = Release|Any CPU
{F5DF2FDC-C860-4CB3-8B24-7C903C6FC076}.Release|x86.Build.0 = Release|Any CPU
{833157E1-1E53-4908-B4CB-5C5507A44582}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{833157E1-1E53-4908-B4CB-5C5507A44582}.Debug|Any CPU.Build.0 = Debug|Any CPU
{833157E1-1E53-4908-B4CB-5C5507A44582}.Debug|x64.ActiveCfg = Debug|Any CPU
{833157E1-1E53-4908-B4CB-5C5507A44582}.Debug|x64.Build.0 = Debug|Any CPU
{833157E1-1E53-4908-B4CB-5C5507A44582}.Debug|x86.ActiveCfg = Debug|Any CPU
{833157E1-1E53-4908-B4CB-5C5507A44582}.Debug|x86.Build.0 = Debug|Any CPU
{833157E1-1E53-4908-B4CB-5C5507A44582}.net46-Debug|Any CPU.ActiveCfg = Debug|Any CPU
{833157E1-1E53-4908-B4CB-5C5507A44582}.net46-Debug|Any CPU.Build.0 = Debug|Any CPU
{833157E1-1E53-4908-B4CB-5C5507A44582}.net46-Debug|x64.ActiveCfg = Debug|Any CPU
{833157E1-1E53-4908-B4CB-5C5507A44582}.net46-Debug|x64.Build.0 = Debug|Any CPU
{833157E1-1E53-4908-B4CB-5C5507A44582}.net46-Debug|x86.ActiveCfg = Debug|Any CPU
{833157E1-1E53-4908-B4CB-5C5507A44582}.net46-Debug|x86.Build.0 = Debug|Any CPU
{833157E1-1E53-4908-B4CB-5C5507A44582}.net46-Release|Any CPU.ActiveCfg = Release|Any CPU
{833157E1-1E53-4908-B4CB-5C5507A44582}.net46-Release|Any CPU.Build.0 = Release|Any CPU
{833157E1-1E53-4908-B4CB-5C5507A44582}.net46-Release|x64.ActiveCfg = Release|Any CPU
{833157E1-1E53-4908-B4CB-5C5507A44582}.net46-Release|x64.Build.0 = Release|Any CPU
{833157E1-1E53-4908-B4CB-5C5507A44582}.net46-Release|x86.ActiveCfg = Release|Any CPU
{833157E1-1E53-4908-B4CB-5C5507A44582}.net46-Release|x86.Build.0 = Release|Any CPU
{833157E1-1E53-4908-B4CB-5C5507A44582}.netcoreapp2.1-Debug|Any CPU.ActiveCfg = Debug|Any CPU
{833157E1-1E53-4908-B4CB-5C5507A44582}.netcoreapp2.1-Debug|Any CPU.Build.0 = Debug|Any CPU
{833157E1-1E53-4908-B4CB-5C5507A44582}.netcoreapp2.1-Debug|x64.ActiveCfg = Debug|Any CPU
{833157E1-1E53-4908-B4CB-5C5507A44582}.netcoreapp2.1-Debug|x64.Build.0 = Debug|Any CPU
{833157E1-1E53-4908-B4CB-5C5507A44582}.netcoreapp2.1-Debug|x86.ActiveCfg = Debug|Any CPU
{833157E1-1E53-4908-B4CB-5C5507A44582}.netcoreapp2.1-Debug|x86.Build.0 = Debug|Any CPU
{833157E1-1E53-4908-B4CB-5C5507A44582}.netcoreapp2.1-Release|Any CPU.ActiveCfg = Release|Any CPU
{833157E1-1E53-4908-B4CB-5C5507A44582}.netcoreapp2.1-Release|Any CPU.Build.0 = Release|Any CPU
{833157E1-1E53-4908-B4CB-5C5507A44582}.netcoreapp2.1-Release|x64.ActiveCfg = Release|Any CPU
{833157E1-1E53-4908-B4CB-5C5507A44582}.netcoreapp2.1-Release|x64.Build.0 = Release|Any CPU
{833157E1-1E53-4908-B4CB-5C5507A44582}.netcoreapp2.1-Release|x86.ActiveCfg = Release|Any CPU
{833157E1-1E53-4908-B4CB-5C5507A44582}.netcoreapp2.1-Release|x86.Build.0 = Release|Any CPU
{833157E1-1E53-4908-B4CB-5C5507A44582}.netcoreapp3.1-Debug|Any CPU.ActiveCfg = Debug|Any CPU
{833157E1-1E53-4908-B4CB-5C5507A44582}.netcoreapp3.1-Debug|Any CPU.Build.0 = Debug|Any CPU
{833157E1-1E53-4908-B4CB-5C5507A44582}.netcoreapp3.1-Debug|x64.ActiveCfg = Debug|Any CPU
{833157E1-1E53-4908-B4CB-5C5507A44582}.netcoreapp3.1-Debug|x64.Build.0 = Debug|Any CPU
{833157E1-1E53-4908-B4CB-5C5507A44582}.netcoreapp3.1-Debug|x86.ActiveCfg = Debug|Any CPU
{833157E1-1E53-4908-B4CB-5C5507A44582}.netcoreapp3.1-Debug|x86.Build.0 = Debug|Any CPU
{833157E1-1E53-4908-B4CB-5C5507A44582}.netcoreapp3.1-Release|Any CPU.ActiveCfg = Release|Any CPU
{833157E1-1E53-4908-B4CB-5C5507A44582}.netcoreapp3.1-Release|Any CPU.Build.0 = Release|Any CPU
{833157E1-1E53-4908-B4CB-5C5507A44582}.netcoreapp3.1-Release|x64.ActiveCfg = Release|Any CPU
{833157E1-1E53-4908-B4CB-5C5507A44582}.netcoreapp3.1-Release|x64.Build.0 = Release|Any CPU
{833157E1-1E53-4908-B4CB-5C5507A44582}.netcoreapp3.1-Release|x86.ActiveCfg = Release|Any CPU
{833157E1-1E53-4908-B4CB-5C5507A44582}.netcoreapp3.1-Release|x86.Build.0 = Release|Any CPU
{833157E1-1E53-4908-B4CB-5C5507A44582}.Release|Any CPU.ActiveCfg = Release|Any CPU
{833157E1-1E53-4908-B4CB-5C5507A44582}.Release|Any CPU.Build.0 = Release|Any CPU
{833157E1-1E53-4908-B4CB-5C5507A44582}.Release|x64.ActiveCfg = Release|Any CPU
{833157E1-1E53-4908-B4CB-5C5507A44582}.Release|x64.Build.0 = Release|Any CPU
{833157E1-1E53-4908-B4CB-5C5507A44582}.Release|x86.ActiveCfg = Release|Any CPU
{833157E1-1E53-4908-B4CB-5C5507A44582}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@ -854,6 +1058,14 @@ Global
{412BCCC8-19F6-489A-B594-E9A506816155} = {771F3F1E-7A68-4A9D-ADA8-A24F1D5BE71D}
{9073ABEF-92E0-4702-BB23-2C99CEF9BDD7} = {C9726AED-D6A3-4AAC-BA04-92DD1F079594}
{FDA6971D-9F57-4DA4-B10A-261C91684CFC} = {0CC4817A-12F3-4357-912C-09315FAAD008}
{71F356DC-DFA3-4163-8BFE-D268722CE189} = {ED952CF7-84DF-437A-B066-F516E9BE1C2C}
{908C7DD3-C999-40A6-9433-9F5ACA7C36F5} = {71F356DC-DFA3-4163-8BFE-D268722CE189}
{0CE216CE-8072-4985-B248-61F0D0BE9C2E} = {71F356DC-DFA3-4163-8BFE-D268722CE189}
{C05F4FFE-6A14-4409-AA0A-10630BE4F1EE} = {71F356DC-DFA3-4163-8BFE-D268722CE189}
{5D1F0032-7B0D-4FB6-A969-FCFB25C9EA1D} = {71F356DC-DFA3-4163-8BFE-D268722CE189}
{650EB7FA-EB0D-4F8E-AB2C-161C3AD8E363} = {71F356DC-DFA3-4163-8BFE-D268722CE189}
{5A7600BD-AED8-44AB-8F2A-7CB33A8D9C02} = {71F356DC-DFA3-4163-8BFE-D268722CE189}
{833157E1-1E53-4908-B4CB-5C5507A44582} = {0CC4817A-12F3-4357-912C-09315FAAD008}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {01D48116-37A2-4D33-B9EC-94793C702431}

Просмотреть файл

@ -0,0 +1,23 @@
#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging.
FROM mcr.microsoft.com/dotnet/core/runtime:3.1-buster-slim AS base
WORKDIR /app
FROM mcr.microsoft.com/dotnet/core/sdk:3.1-buster AS build
WORKDIR /sqlclient
COPY . .
ARG PROJNAME="Microsoft.Data.SqlClient.DockerLinuxTest"
ARG PROJFILE=$PROJNAME".csproj"
ARG DLLFILE=$PROJNAME".dll"
WORKDIR /sqlclient/src/Microsoft.Data.SqlClient/tests/DockerLinuxTest
RUN dotnet build $PROJFILE -c Release -o /app/build -p:OSGroup=Unix -p:GenerateDocumentationFile=false
FROM build AS publish
RUN dotnet publish $PROJFILE -c Release -o /app/publish -p:OSGroup=Unix -p:GenerateDocumentationFile=false
FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", $DLLFILE]

Просмотреть файл

@ -0,0 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
<DockerfileContext>..\..\..\..</DockerfileContext>
<OSGroup>Unix</OSGroup>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.9.10" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\netcore\src\Microsoft.Data.SqlClient.csproj" />
</ItemGroup>
</Project>

Просмотреть файл

@ -0,0 +1,28 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System;
using Microsoft.Data.SqlClient;
namespace Microsoft.Data.SqlClient.DockerLinuxTest
{
class Program
{
static string server = "microsoft.sqlserver";
static string user = "sa";
// Provide password as set in docker-compose.yml
static string pwd = "P@ssw0rd!123";
static void Main(string[] args)
{
using (SqlConnection sqlConnection = new SqlConnection($"Server={server}; UID={user}; PWD={pwd}"))
{
sqlConnection.Open();
Console.WriteLine($"Connected to SQL Server v{sqlConnection.ServerVersion} from {Environment.OSVersion.VersionString}");
// Write your code here to debug inside Docker Linux containers.
}
}
}
}

Просмотреть файл

@ -0,0 +1,10 @@
{
"profiles": {
"Microsoft.Data.SqlClient.DockerLinuxTest": {
"commandName": "Project"
},
"Docker": {
"commandName": "Docker"
}
}
}

18
src/docker-compose.dcproj Normal file
Просмотреть файл

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" Sdk="Microsoft.Docker.Sdk">
<PropertyGroup Label="Globals">
<ProjectVersion>2.1</ProjectVersion>
<DockerTargetOS>Linux</DockerTargetOS>
<ProjectGuid>f5df2fdc-c860-4cb3-8b24-7c903c6fc076</ProjectGuid>
</PropertyGroup>
<PropertyGroup>
<DockerServiceName>microsoft.data.sqlclient.dockertests</DockerServiceName>
</PropertyGroup>
<ItemGroup>
<None Include=".dockerignore" />
<None Include="docker-compose.override.yml">
<DependentUpon>docker-compose.yml</DependentUpon>
</None>
<None Include="docker-compose.yml" />
</ItemGroup>
</Project>

Просмотреть файл

@ -0,0 +1,3 @@
version: '3.4'
services:
microsoft.data.sqlclient.dockertests:

18
src/docker-compose.yml Normal file
Просмотреть файл

@ -0,0 +1,18 @@
version: '3.4'
services:
microsoft.data.sqlclient.dockertests:
image: ${DOCKER_REGISTRY-}microsoftdatasqlclientdockerlinuxtest
build:
context: ../
dockerfile: src/Microsoft.Data.SqlClient/tests/DockerLinuxTest/Dockerfile
depends_on:
- microsoft.sqlserver
microsoft.sqlserver:
image: mcr.microsoft.com/mssql/server:2019-latest
environment:
- SA_PASSWORD=P@ssw0rd!123
- ACCEPT_EULA=Y
ports:
- "5434:1433"

Просмотреть файл

@ -1,25 +1,33 @@
{
"tool": "Credential Scanner",
"suppressions": [
{
"file": "TdsServerCertificate.pfx",
"_justification": "The dummy certificate used for internal testing"
},
{
"file": "config.ps1",
"_justification": "Contains dummy passwords used for internal testing"
},
{
"file": "SqlConnectionBasicTests.cs",
"_justification": "Contains dummy passwords used for internal testing"
},
{
"file": "ExceptionTest.cs",
"_justification": "Contains dummy passwords used for internal testing"
},
{
"file": "TDSServerArguments.cs",
"_justification": "Contains dummy passwords used for internal testing"
}
]
}
"tool": "Credential Scanner",
"suppressions": [
{
"file": "TdsServerCertificate.pfx",
"_justification": "The dummy certificate used for internal testing"
},
{
"file": "config.ps1",
"_justification": "Contains dummy passwords used for internal testing"
},
{
"file": "SqlConnectionBasicTests.cs",
"_justification": "Contains dummy passwords used for internal testing"
},
{
"file": "ExceptionTest.cs",
"_justification": "Contains dummy passwords used for internal testing"
},
{
"file": "TDSServerArguments.cs",
"_justification": "Contains dummy passwords used for internal testing"
},
{
"file": "Program.cs",
"_justification": "Contains dummy passwords used for docker testing"
},
{
"file": "docker-compose.yml",
"_justification": "Contains dummy passwords used for docker testing"
}
]
}