cake-build / cake

:cake: Cake (C# Make) is a cross platform build automation system.
https://cakebuild.net
MIT License
3.91k stars 730 forks source link

It's not possible to use Microsoft.Data.SqlClient #3540

Closed rodrigoramos closed 2 years ago

rodrigoramos commented 3 years ago

Prerequisites

Cake runner

Cake .NET Tool, Cake runner for .NET Core

Cake version

1.2.0

Operating system

Linux

Operating system architecture

64-Bit

CI Server

No response

What are you seeing?

It's not possible to use Microsoft.Data.SqlClient nuget on cake script. Some addins like Cake.SqlServer and Cake.SqlTools cannot be used.

The following error is showed:

An error occurred when executing task 'Test'.
Error: One or more errors occurred. (Strings.PlatformNotSupported_DataSqlClient)
    Strings.PlatformNotSupported_DataSqlClient

What is expected?

I expect to be able to use this package. Like a I said before, it's referenced by addins which handles databases.

In the same machine/environment, we create a new console application, adding the same package as reference and running this application, it'll work as expected.

Steps to Reproduce

  1. In a new folder, create dotnet tool manifest:
    dotnet new tool-manifest
  2. Install cake tool
    dotnet tool install Cake.Tool --version 1.2.0
  3. Create a build.cake script with the following contents:

    #addin "nuget:?package=Microsoft.Data.SqlClient&version=3.0.0"
    
    var target = Argument("target", "Test");
    
    Task("Test")
      .Does(() =>
      {
          const string connStr = "<your connection string>";
    
          var conn = new Microsoft.Data.SqlClient.SqlConnection(connStr);
    
      });
    
     RunTarget(target);
  4. Run cake script:
    dotnet cake

Output log

Looking for modules...
No modules found to install.
Module directory does not exist.
Analyzing build script...
Analyzing /tmp/fk/build.cake...
Processing build script...
Installing addins...
Resolving assembly 'System.Private.Uri.resources, Version=4.0.6.0, Culture=en-US, PublicKeyToken=b03f5f7f11d50a3a' using runtime installed at '/home/rramos/.dotnet/shared/Microsoft.NETCore.App/3.1.18/'...
Exception occurred while resolving assembly System.Private.Uri.resources: Could not load file or assembly 'System.Private.Uri.resources, Version=4.0.6.0, Culture=en-US, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified.

Trying to resolve assembly System.Private.Uri.resources as 'System.Private.Uri, Version=4.0.6.0, Culture=en-US, PublicKeyToken=b03f5f7f11d50a3a'...
Assembly System.Private.Uri resolved as 'System.Private.Uri, Version=4.0.6.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' (file location: '/home/rramos/.dotnet/shared/Microsoft.NETCore.App/3.1.18/System.Private.Uri.dll')
The addin Microsoft.Data.SqlClient will reference Microsoft.Data.SqlClient.dll.
Verifying assembly 'Microsoft.Data.SqlClient, Version=2.0.20168.4, Culture=neutral, PublicKeyToken=23ec7fc2d6eaa4a5'.
Adding assembly reference to System.Private.CoreLib.dll...
Adding assembly reference to System.Linq.Expressions.dll...
Adding assembly reference to Microsoft.CSharp.dll...
Adding assembly reference to Cake.Core.dll...
Adding assembly reference to Cake.Common.dll...
Adding assembly reference to Spectre.Console.dll...
Adding assembly reference to netstandard.dll...
Adding assembly reference to Microsoft.Win32.Registry.dll...
Adding assembly reference to System.Memory.dll...
Adding assembly reference to Wcwidth.dll...
Adding assembly reference to Microsoft.Data.SqlClient.dll...
Importing namespace Cake.Common...
Importing namespace Cake.Common.Build...
Importing namespace Cake.Common.Build.AppVeyor...
Importing namespace Cake.Common.Build.AppVeyor.Data...
Importing namespace Cake.Common.Build.AzurePipelines...
Importing namespace Cake.Common.Build.AzurePipelines.Data...
Importing namespace Cake.Common.Build.Bamboo...
Importing namespace Cake.Common.Build.Bamboo.Data...
Importing namespace Cake.Common.Build.BitbucketPipelines...
Importing namespace Cake.Common.Build.BitbucketPipelines.Data...
Importing namespace Cake.Common.Build.Bitrise...
Importing namespace Cake.Common.Build.Bitrise.Data...
Importing namespace Cake.Common.Build.ContinuaCI...
Importing namespace Cake.Common.Build.ContinuaCI.Data...
Importing namespace Cake.Common.Build.GitHubActions...
Importing namespace Cake.Common.Build.GitHubActions.Data...
Importing namespace Cake.Common.Build.GitLabCI...
Importing namespace Cake.Common.Build.GitLabCI.Data...
Importing namespace Cake.Common.Build.GoCD...
Importing namespace Cake.Common.Build.GoCD.Data...
Importing namespace Cake.Common.Build.Jenkins...
Importing namespace Cake.Common.Build.Jenkins.Data...
Importing namespace Cake.Common.Build.MyGet...
Importing namespace Cake.Common.Build.TeamCity...
Importing namespace Cake.Common.Build.TravisCI...
Importing namespace Cake.Common.Build.TravisCI.Data...
Importing namespace Cake.Common.Diagnostics...
Importing namespace Cake.Common.IO...
Importing namespace Cake.Common.IO.Paths...
Importing namespace Cake.Common.Net...
Importing namespace Cake.Common.Security...
Importing namespace Cake.Common.Solution...
Importing namespace Cake.Common.Solution.Project...
Importing namespace Cake.Common.Solution.Project.Properties...
Importing namespace Cake.Common.Solution.Project.XmlDoc...
Importing namespace Cake.Common.Text...
Importing namespace Cake.Common.Tools.Cake...
Importing namespace Cake.Common.Tools.Chocolatey...
Importing namespace Cake.Common.Tools.Chocolatey.ApiKey...
Importing namespace Cake.Common.Tools.Chocolatey.Config...
Importing namespace Cake.Common.Tools.Chocolatey.Download...
Importing namespace Cake.Common.Tools.Chocolatey.Features...
Importing namespace Cake.Common.Tools.Chocolatey.Install...
Importing namespace Cake.Common.Tools.Chocolatey.New...
Importing namespace Cake.Common.Tools.Chocolatey.Pack...
Importing namespace Cake.Common.Tools.Chocolatey.Pin...
Importing namespace Cake.Common.Tools.Chocolatey.Push...
Importing namespace Cake.Common.Tools.Chocolatey.Sources...
Importing namespace Cake.Common.Tools.Chocolatey.Uninstall...
Importing namespace Cake.Common.Tools.Chocolatey.Upgrade...
Importing namespace Cake.Common.Tools.DotCover...
Importing namespace Cake.Common.Tools.DotCover.Analyse...
Importing namespace Cake.Common.Tools.DotCover.Cover...
Importing namespace Cake.Common.Tools.DotCover.Merge...
Importing namespace Cake.Common.Tools.DotCover.Report...
Importing namespace Cake.Common.Tools.DotNetCore...
Importing namespace Cake.Common.Tools.DotNetCore.Build...
Importing namespace Cake.Common.Tools.DotNetCore.BuildServer...
Importing namespace Cake.Common.Tools.DotNetCore.Clean...
Importing namespace Cake.Common.Tools.DotNetCore.Execute...
Importing namespace Cake.Common.Tools.DotNetCore.MSBuild...
Importing namespace Cake.Common.Tools.DotNetCore.NuGet.Delete...
Importing namespace Cake.Common.Tools.DotNetCore.NuGet.Push...
Importing namespace Cake.Common.Tools.DotNetCore.NuGet.Source...
Importing namespace Cake.Common.Tools.DotNetCore.Pack...
Importing namespace Cake.Common.Tools.DotNetCore.Publish...
Importing namespace Cake.Common.Tools.DotNetCore.Restore...
Importing namespace Cake.Common.Tools.DotNetCore.Run...
Importing namespace Cake.Common.Tools.DotNetCore.Test...
Importing namespace Cake.Common.Tools.DotNetCore.Tool...
Importing namespace Cake.Common.Tools.DotNetCore.VSTest...
Importing namespace Cake.Common.Tools.DupFinder...
Importing namespace Cake.Common.Tools.Fixie...
Importing namespace Cake.Common.Tools.GitLink...
Importing namespace Cake.Common.Tools.GitReleaseManager...
Importing namespace Cake.Common.Tools.GitReleaseManager.AddAssets...
Importing namespace Cake.Common.Tools.GitReleaseManager.Close...
Importing namespace Cake.Common.Tools.GitReleaseManager.Create...
Importing namespace Cake.Common.Tools.GitReleaseManager.Discard...
Importing namespace Cake.Common.Tools.GitReleaseManager.Export...
Importing namespace Cake.Common.Tools.GitReleaseManager.Label...
Importing namespace Cake.Common.Tools.GitReleaseManager.Open...
Importing namespace Cake.Common.Tools.GitReleaseManager.Publish...
Importing namespace Cake.Common.Tools.GitReleaseNotes...
Importing namespace Cake.Common.Tools.GitVersion...
Importing namespace Cake.Common.Tools.ILMerge...
Importing namespace Cake.Common.Tools.ILRepack...
Importing namespace Cake.Common.Tools.InnoSetup...
Importing namespace Cake.Common.Tools.InspectCode...
Importing namespace Cake.Common.Tools.MSBuild...
Importing namespace Cake.Common.Tools.MSpec...
Importing namespace Cake.Common.Tools.MSTest...
Importing namespace Cake.Common.Tools.NSIS...
Importing namespace Cake.Common.Tools.NuGet...
Importing namespace Cake.Common.Tools.NuGet.Add...
Importing namespace Cake.Common.Tools.NuGet.Delete...
Importing namespace Cake.Common.Tools.NuGet.Init...
Importing namespace Cake.Common.Tools.NuGet.Install...
Importing namespace Cake.Common.Tools.NuGet.List...
Importing namespace Cake.Common.Tools.NuGet.Pack...
Importing namespace Cake.Common.Tools.NuGet.Push...
Importing namespace Cake.Common.Tools.NuGet.Restore...
Importing namespace Cake.Common.Tools.NuGet.SetApiKey...
Importing namespace Cake.Common.Tools.NuGet.SetProxy...
Importing namespace Cake.Common.Tools.NuGet.Sources...
Importing namespace Cake.Common.Tools.NuGet.Update...
Importing namespace Cake.Common.Tools.NUnit...
Importing namespace Cake.Common.Tools.OctopusDeploy...
Importing namespace Cake.Common.Tools.OpenCover...
Importing namespace Cake.Common.Tools.ReportGenerator...
Importing namespace Cake.Common.Tools.ReportUnit...
Importing namespace Cake.Common.Tools.Roundhouse...
Importing namespace Cake.Common.Tools.SignTool...
Importing namespace Cake.Common.Tools.SpecFlow...
Importing namespace Cake.Common.Tools.SpecFlow.StepDefinitionReport...
Importing namespace Cake.Common.Tools.SpecFlow.TestExecutionReport...
Importing namespace Cake.Common.Tools.TextTransform...
Importing namespace Cake.Common.Tools.VSTest...
Importing namespace Cake.Common.Tools.VSWhere...
Importing namespace Cake.Common.Tools.VSWhere.All...
Importing namespace Cake.Common.Tools.VSWhere.Latest...
Importing namespace Cake.Common.Tools.VSWhere.Legacy...
Importing namespace Cake.Common.Tools.VSWhere.Product...
Importing namespace Cake.Common.Tools.WiX...
Importing namespace Cake.Common.Tools.WiX.Heat...
Importing namespace Cake.Common.Tools.XBuild...
Importing namespace Cake.Common.Tools.XUnit...
Importing namespace Cake.Common.Xml...
Importing namespace Cake.Core...
Importing namespace Cake.Core.Diagnostics...
Importing namespace Cake.Core.IO...
Importing namespace Cake.Core.Scripting...
Importing namespace System...
Importing namespace System.Collections.Generic...
Importing namespace System.IO...
Importing namespace System.Linq...
Importing namespace System.Text...
Importing namespace System.Threading.Tasks...
Compiling build script...

========================================
Test
========================================
Executing task: Test
An error occurred when executing task 'Test'.
Error: System.AggregateException: One or more errors occurred. (Strings.PlatformNotSupported_DataSqlClient)
 ---> System.PlatformNotSupportedException: Strings.PlatformNotSupported_DataSqlClient
   at Microsoft.Data.SqlClient.SqlConnection..ctor(String connectionString) in /_/artifacts/Project/obj/Release.AnyCPU/Microsoft.Data.SqlClient/netcore/netcoreapp3.1/Microsoft.Data.SqlClient.notsupported.cs:line 386
   at Submission#0.<>c.<<Initialize>>b__0_0()
   at Cake.Core.CakeTaskBuilderExtensions.<>c__DisplayClass31_0.<Does>b__0(ICakeContext _) in C:\projects\cake\src\Cake.Core\CakeTaskBuilder.Execution.cs:line 26
   at Cake.Core.CakeTaskBuilderExtensions.<>c__DisplayClass34_0.<Does>b__0(ICakeContext context) in C:\projects\cake\src\Cake.Core\CakeTaskBuilder.Execution.cs:line 82
   at Cake.Core.CakeTask.Execute(ICakeContext context) in C:\projects\cake\src\Cake.Core\CakeTask.cs:line 119
   at Cake.Core.DefaultExecutionStrategy.ExecuteAsync(CakeTask task, ICakeContext context) in C:\projects\cake\src\Cake.Core\DefaultExecutionStrategy.cs:line 74
   at Cake.Core.CakeEngine.ExecuteTaskAsync(ICakeContext context, IExecutionStrategy strategy, Stopwatch stopWatch, CakeTask task, CakeReport report) in C:\projects\cake\src\Cake.Core\CakeEngine.cs:line 278
   at Cake.Core.CakeEngine.ExecuteTaskAsync(ICakeContext context, IExecutionStrategy strategy, Stopwatch stopWatch, CakeTask task, CakeReport report) in C:\projects\cake\src\Cake.Core\CakeEngine.cs:line 303
   at Cake.Core.CakeEngine.ExecuteTaskAsync(ICakeContext context, IExecutionStrategy strategy, Stopwatch stopWatch, CakeTask task, CakeReport report) in C:\projects\cake\src\Cake.Core\CakeEngine.cs:line 311
   at Cake.Core.CakeEngine.RunTask(ICakeContext context, IExecutionStrategy strategy, CakeTask task, String target, Stopwatch stopWatch, CakeReport report) in C:\projects\cake\src\Cake.Core\CakeEngine.cs:line 226
   at Cake.Core.CakeEngine.RunTargetAsync(ICakeContext context, IExecutionStrategy strategy, ExecutionSettings settings) in C:\projects\cake\src\Cake.Core\CakeEngine.cs:line 189
   at Cake.Cli.BuildScriptHost`1.RunTargetAsync(String target) in C:\projects\cake\src\Cake.Cli\Hosts\BuildScriptHost.cs:line 73
   at Cake.Core.Scripting.ScriptHost.RunTarget(String target) in C:\projects\cake\src\Cake.Core\Scripting\ScriptHost.cs:line 105
   at Submission#0.<<Initialize>>d__0.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at Microsoft.CodeAnalysis.Scripting.ScriptExecutionState.RunSubmissionsAsync[TResult](ImmutableArray`1 precedingExecutors, Func`2 currentExecutor, StrongBox`1 exceptionHolderOpt, Func`2 catchExceptionOpt, CancellationToken cancellationToken)
   at Microsoft.CodeAnalysis.Scripting.Script`1.RunSubmissionsAsync(ScriptExecutionState executionState, ImmutableArray`1 precedingExecutors, Func`2 currentExecutor, Func`2 catchExceptionOpt, CancellationToken cancellationToken)
   --- End of inner exception stack trace ---
   at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
   at Cake.Infrastructure.Scripting.RoslynScriptSession.Execute(Script script) in C:\projects\cake\src\Cake\Infrastructure\Scripting\RoslynScriptSession.cs:line 167
   at Cake.Core.Scripting.ScriptRunner.Run(IScriptHost host, FilePath scriptPath) in C:\projects\cake\src\Cake.Core\Scripting\ScriptRunner.cs:line 173
   at Cake.Features.Building.BuildFeature.RunCore(IRemainingArguments arguments, BuildFeatureSettings settings) in C:\projects\cake\src\Cake\Features\Building\BuildFeature.cs:line 99
   at Cake.Features.Building.BuildFeature.Run(IRemainingArguments arguments, BuildFeatureSettings settings) in C:\projects\cake\src\Cake\Features\Building\BuildFeature.cs:line 49
   at Cake.Commands.DefaultCommand.Execute(CommandContext context, DefaultCommandSettings settings) in C:\projects\cake\src\Cake\Commands\DefaultCommand.cs:line 72
augustoproiete commented 3 years ago

Possibly related from Microsoft's SQL Client FAQ (emphasis mine):

Why do I get a PlatformNotSupported exception when my application hits a SqlClient method? The Microsoft.Data.SqlClient NuGet package includes a number of DLLs supporting different .NET targets and different runtime platforms. If you are getting a PlatformNotSupported Exception when you don't think you should be, it ultimately means your application is not loading the appropriate DLL. There could be a number of reasons for this. The NuGet package structure and infrastructure around referencing and loading referenced NuGet packages includes logic that allows a package to contain multiple DLLs which implement support for different .NET and platform targets. Meaning a different DLL for .NET Framework, .NET Core, .NET Standard, Windows, Linux, etc. The NuGet infrastructure will automatically reference and load the appropriate DLL based on your application's needs.

If your application loads a DLL from a NuGet package directly, it bypasses all this logic and probably loads the incorrect DLL. The DLL in the NuGet package under lib/netstandard2.0/Microsoft.Data.SqlClient.dll is basically the fallback DLL for any unsupported target and simply throws the PlatformNotSupported exception for any call. This is a nicer exception than what you would otherwise get when running on a platform that does not have a DLL built for it. Ultimately, you want to use the NuGet package reference infrastructure or you would have to implement all this target framework and platform support logic yourself when determining which DLL to load.

Additionally, the NuGet package contains all the dependency information for the SqlClient library and facilitates the downloading and referencing of dependencies. If you reference and load an individual DLL manually, it is up to you to ensure all dependencies are also available to the SqlClient library.

Needs further investigation, but the above suggests that Cake might be loading the netstandard2.0 assembly rather than the assembly for the corresponding TFM of the Cake runner e.g. netcoreapp3.1

augustoproiete commented 3 years ago

Reproducible on OSX using the script above:

image

AdaskoTheBeAsT commented 2 years ago

Hi,

I will take a look at this and get back to you

AdaskoTheBeAsT commented 2 years ago

indeed there is problem with OSX - I try to find some help - I do not know if it is not connected with the fact that Microsoft.Data.SqlClient do not contain only folder for unix and not for osx - if Cake somewhat does not influence there in WSL2 Ubuntu 20.04 it looks like below

image

AdaskoTheBeAsT commented 2 years ago

on OSX I receive for simplified sample image

AdaskoTheBeAsT commented 2 years ago

this is really hard - I am curious if same thing appear in cake.frosting - if yes then cloning repo of MS.D.SqlClient will be necessary

AdaskoTheBeAsT commented 2 years ago

in frosting there is no problem... image

AdaskoTheBeAsT commented 2 years ago

...but :smile: it seems that in cake 1.3.0 it was fixed - can you please force upgrade to 1.3.0?

this is from my machine image

rodrigoramos commented 2 years ago

Ok! I'll give a try with 1.3 version and I'll let you know.

Em qui., 18 de nov. de 2021 16:05, Adam Pluciński @.***> escreveu:

...but 😄 it seems that in cake 1.3.0 it was fixed - can you please force upgrade to 1.3.0?

this is from my machine [image: image] https://user-images.githubusercontent.com/1914201/142480354-3eafbfb9-a49b-4cb3-a739-3f7cd186b511.png

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/cake-build/cake/issues/3540#issuecomment-973170417, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAL64CIT7JKZ5FF2QB3OE63UMVFA3ANCNFSM5FRR4Z4A . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

augustoproiete commented 2 years ago

@AdaskoTheBeAsT @rodrigoramos FYI I still see the same error with Cake 1.3.0:

image

#addin "nuget:?package=Microsoft.Data.SqlClient&version=3.0.0&loaddependencies=true"

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

Task("Test")
  .Does(() =>
{
      const string connStr = "Data Source=server;";

      var conn = new Microsoft.Data.SqlClient.SqlConnection(connStr);
 });

 RunTarget(target);
AdaskoTheBeAsT commented 2 years ago

That is really mysterious thing - i will try to uninstall vs mono etc and start with clean state

AdaskoTheBeAsT commented 2 years ago

hi

@rodrigoramos @augustoproiete could you please check with .net core 6.0.101?

it seems it is not connected with cake

https://github.com/dotnet/SqlClient/issues/1427

devlead commented 2 years ago

Is this still an issue I just in Cake 2.1 tried the following

#addin nuget:?package=Microsoft.Data.SqlClient&version=4.1.0&loaddependencies=true

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

Task("Test")
  .Does(() =>
  {
      const string connStr = "Data Source=localhost,1433;Integrated Security=False;User ID=SA;Password=YourStrong@Passw0rd;Encrypt=False";

      var conn = new Microsoft.Data.SqlClient.SqlConnection(connStr);

      conn.Open();
  });

 RunTarget(target);

And it ran without error image

devlead commented 2 years ago

This issue seems to have been fixed, if issue persists please feel free to reopen issue.

Sebazzz commented 1 year ago

This issue seems to have been fixed, if issue persists please feel free to reopen issue.

Nope, happens again:

Resolving assembly 'Microsoft.Data.SqlClient.resources, Version=5.0.0.0, Culture=en-US, PublicKeyToken=23ec7fc2d6eaa4a5' using runtime installed at 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.3\'... Exception occurred while resolving assembly Microsoft.Data.SqlClient.resources: Could not load file or assembly 'Microsoft.Data.SqlClient.resources, Version=5.0.0.0, Culture=en-US, PublicKeyToken=23ec7fc2d6eaa4a5'. The system cannot find the file specified. Trying to resolve assembly Microsoft.Data.SqlClient.resources as 'Microsoft.Data.SqlClient, Version=5.0.0.0, Culture=en-US, PublicKeyToken=23ec7fc2d6eaa4a5'... Assembly Microsoft.Data.SqlClient resolved as 'Microsoft.Data.SqlClient, Version=5.0.0.0, Culture=neutral, PublicKeyToken=23ec7fc2d6eaa4a5' (file location: 'C:\Projects......\tools\Addins\Microsoft.Data.SqlClient.5.1.0\runtimes\win\lib\net6.0\Microsoft.Data.SqlClient.dll')

augustoproiete commented 1 year ago

@Sebazzz Do you have a Cake script that reproduces this error?

Sebazzz commented 1 year ago
#addin nuget:?package=Microsoft.Data.SqlClient&version=5.1.0&loaddependencies=true
using Microsoft.Data.SqlClient;

var connectionString = $"Data Source=localhost;Application Name=Build Script;Initial Catalog=master;Integrated Security=true;Encrypt=false";

void ExecuteSqlCommand(string command) {
    Verbose("Opening connection to {0}", connectionString);
    using SqlConnection sqlConnection = new(connectionString);
    sqlConnection.Open();

    Verbose("Executing command: {0}", command);
    using SqlCommand cmd = (SqlCommand) sqlConnection.CreateCommand();
    cmd.CommandText = command;
    cmd.ExecuteNonQuery();
}

ExecuteSqlCommand("SELECT 1");

Running under .NET SDK 7.0.100.

augustoproiete commented 1 year ago

@Sebazzz What OS are you running this on?

I'm not able to reproduce (on my laptop at least):

Analyzing build script...
Processing build script...
Installing addins...
Compiling build script...
Opening connection to Data Source=localhost;Application Name=Build Script;Initial Catalog=master;Integrated Security=true;Encrypt=false

dotnet tool list
Package Id      Version      Commands         Manifest                                                       
-------------------------------------------------------------------------------------------------------------
cake.tool       3.0.0        dotnet-cake      /Users/augustoproiete/cake/tool/3.0.0/.config/dotnet-tools.json

dotnet --info
.NET SDK:
 Version:   7.0.101
 Commit:    bb24aafa11

Runtime Environment:
 OS Name:     Mac OS X
 OS Version:  13.2
 OS Platform: Darwin
 RID:         osx.13-x64
 Base Path:   /usr/local/share/dotnet/sdk/7.0.101/

Host:
  Version:      7.0.1
  Architecture: x64
  Commit:       97203d38ba

.NET SDKs installed:
  3.1.202 [/usr/local/share/dotnet/sdk]
  3.1.300 [/usr/local/share/dotnet/sdk]
  3.1.301 [/usr/local/share/dotnet/sdk]
  3.1.302 [/usr/local/share/dotnet/sdk]
  3.1.402 [/usr/local/share/dotnet/sdk]
  3.1.414 [/usr/local/share/dotnet/sdk]
  5.0.100 [/usr/local/share/dotnet/sdk]
  5.0.102 [/usr/local/share/dotnet/sdk]
  5.0.203 [/usr/local/share/dotnet/sdk]
  5.0.402 [/usr/local/share/dotnet/sdk]
  6.0.100 [/usr/local/share/dotnet/sdk]
  6.0.101 [/usr/local/share/dotnet/sdk]
  6.0.301 [/usr/local/share/dotnet/sdk]
  7.0.100 [/usr/local/share/dotnet/sdk]
  7.0.101 [/usr/local/share/dotnet/sdk]
Sebazzz commented 1 year ago

@augustoproiete I can't either anymore. I think Cake doesn't honor loaddependencies if the main dependency is already locally restored - because after a clean build I was able to use it as expected.

augustoproiete commented 1 year ago

@Sebazzz I tried building a few times both on OSX and Windows 11 and couldn't reproduce. If you find a way to repro this let us know