cake-contrib / cake-contrib/Cake.SqlServer

Cake.SqlServer doesn't work right out of the box

Open
#76 3 comments 1 reaction 0 assignees View on GitHub
Dominant language
C#
Stars
29
Forks
17
PR merge metrics
No merged PRs in 30d

Description

## Description
Creating a new cake script using `dotnet tool` and try to use any alias from Cake.SqlServer, we get the following error:
```
(3292,5): error CS0012: The type 'SqlConnection' is defined in an assembly that is not referenced. You must add a reference to assembly 'Microsoft.Data.SqlClient, Version=2.0.20168.4, Culture=neutral, PublicKeyToken=23ec7fc2d6eaa4a5'.
```

## Steps to Reproduce
### Steps
1. In a new folder, create dotnet tool manifest:
```bash
dotnet new tool-manifest
```
0. Install cake tool
```bash
dotnet tool install Cake.Tool --version 1.2.0
```
0. Create a build.cake script with the following contents:
```
#addin "Cake.SqlServer&version=3.0.0"

var target = Argument("target", "Test");

Task("Test")
.Does(() =>
{
const string connStr = "";
CreateDatabaseIfNotExists(connStr, "EXAMPLE_DATABASE");
});

RunTarget(target);
```
0. Run cake script:
```bash
dotnet cake
```
### Expected Result
The script should run without issues and create the database "EXAMPLE_DATABASE"

### Actual Result
The following output (with errors) is presented:
```
Could not load /tmp/fk/tools/Addins/Cake.SqlServer.3.0.0/lib/net5.0/Cake.SqlServer.dll (missing Microsoft.Data.SqlClient, Version=2.0.20168.4, Culture=neutral, PublicKeyToken=23ec7fc2d6eaa4a5))
(3292,5): error CS0012: The type 'SqlConnection' is defined in an assembly that is not referenced. You must add a reference to assembly 'Microsoft.Data.SqlClient, Version=2.0.20168.4, Culture=neutral, PublicKeyToken=23ec7fc2d6eaa4a5'.
Error: Error(s) occurred when compiling build script:
(3292,5): error CS0012: The type 'SqlConnection' is defined in an assembly that is not referenced. You must add a reference to assembly 'Microsoft.Data.SqlClient, Version=2.0.20168.4, Culture=neutral, PublicKeyToken=23ec7fc2d6eaa4a5'.
```

## Environment
SO: Linux Manjaro
Dotnet SDK: 5.0.400
Dotnet Runtime:
- Microsoft.NETCore.App 5.0.9
- Microsoft.AspNetCore.App 5.0.9

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.