Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not working with "Cake.Core" Version="3.1.0" #56

Open
sanjaykulkarni04 opened this issue Feb 23, 2024 · 2 comments
Open

Not working with "Cake.Core" Version="3.1.0" #56

sanjaykulkarni04 opened this issue Feb 23, 2024 · 2 comments

Comments

@sanjaykulkarni04
Copy link

Hi Team,

I am receiving the below error when I upgraded to "Cake.Core" Version="3.1.0". How to fix this issue?

Error: System.NullReferenceException: Object reference not set to an instance of an object.
at Submission#0.Build.<>c.<.cctor>b__108_0(GitVersion version)
at Submission#0.Build.get_Version()
at Submission#0.SlackReport.Send(ICakeContext context)
at Submission#0.<>c.<>b__0_0(ITeardownContext context)

at Cake.Core.DefaultExecutionStrategy.PerformTeardown(Action1 action, ITeardownContext teardownContext) in C:\projects\cake\src\Cake.Core\DefaultExecutionStrategy.cs:line 56 at Cake.Core.CakeEngine.PerformTeardown(IExecutionStrategy strategy, ICakeContext context, Stopwatch stopWatch, CakeReport report, Boolean exceptionWasThrown, Exception thrownException) in C:\projects\cake\src\Cake.Core\CakeEngine.cs:line 510 at Cake.Core.CakeEngine.RunTargetAsync(ICakeContext context, IExecutionStrategy strategy, ExecutionSettings settings) in C:\projects\cake\src\Cake.Core\CakeEngine.cs:line 212 at Cake.Cli.BuildScriptHost1.internalRunTargetAsync() in C:\projects\cake\src\Cake.Cli\Hosts\BuildScriptHost.cs:line 87
at Cake.Cli.BuildScriptHost1.RunTargetAsync(String target) in C:\projects\cake\src\Cake.Cli\Hosts\BuildScriptHost.cs:line 74 1241&logView=flowAware&linesState=1241) at Cake.Core.Scripting.ScriptHost.RunTarget(String target) in C:\projects\cake\src\Cake.Core\Scripting\ScriptHost.cs:line 110 at Submission#0.<<Initialize>>d__0.MoveNext() --- End of stack trace from previous location --- at Microsoft.CodeAnalysis.Scripting.ScriptExecutionState.RunSubmissionsAsync[TResult](ImmutableArray1 precedingExecutors, Func2 currentExecutor, StrongBox1 exceptionHolderOpt, Func2 catchExceptionOpt, CancellationToken cancellationToken) at Microsoft.CodeAnalysis.Scripting.Script1.RunSubmissionsAsync(ScriptExecutionState executionState, ImmutableArray1 precedingExecutors, Func2 currentExecutor, Func`2 catchExceptionOpt, CancellationToken cancellationToken)
at Cake.Infrastructure.Scripting.RoslynScriptSession.Execute(Script script) in C:\projects\cake\src\Cake\Infrastructure\Scripting\RoslynScriptSession.cs:line 206
at Cake.Core.Scripting.ScriptRunner.Run(IScriptHost host, FilePath scriptPath) in C:\projects\cake\src\Cake.Core\Scripting\ScriptRunner.cs:line 172
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 73

Regards,
Sanjay

@nils-a
Copy link
Contributor

nils-a commented Feb 23, 2024

Not sure, what the problem is here.
I have used Cake.Slack v2.0.0 successfully using Cake 3.0.0, 3.1.0, and 4.0.0.

Maybe you could share a bit more of your code or more of the error. You could try to call the build using --verbosity=diagnostic to get more logging.

@sanjaykulkarni04
Copy link
Author

sanjaykulkarni04 commented Feb 24, 2024

--verbosity=diagnostic

yeah, I got this detailed log using --verbosity=diagnostic only. Below is the list of NuGet pkg I am referring to. Am I missing anything? I will see if I provide you with more info or code.

#addin nuget:?package=Cake.Slack&version=2.0.0
#addin nuget:?package=Cake.Docker&version=1.2.0
#addin nuget:?package=Cake.Curl&version=4.1.0
#addin nuget:?package=Cake.Yarn&version=2.0.0
#addin nuget:?package=Cake.Npm&version=3.0.0
#addin nuget:?package=Cake.FileHelpers&version=6.1.3
#addin nuget:?package=Syncromatics.Cake.Helm&version=2.1.0
#addin nuget:?package=Cake.Git&version=3.0.0
#addin nuget:?package=Cake.DocFx&version=1.0.0
#addin nuget:?package=Cake.Powershell&version=2.0.0&loaddependencies=true
#addin nuget:?package=Newtonsoft.Json&version=13.0.3&loaddependencies=true
#addin nuget:?package=AWSSDK.Core&version=3.7.106.13&loaddependencies=true
#addin nuget:?package=AWSSDK.ECR&version=3.7.100.106&loaddependencies=true
#addin nuget:?package=AWSSDK.S3&version=3.7.103.43&loaddependencies=true
#addin nuget:?package=log4net&version=2.0.15

#tool "nuget:?package=NuGet.CommandLine&version=6.5.0"
//#tool "nuget:?package=Microsoft.VisualStudio.Services.NuGet.Bootstrap&version=0.1.3&include=/**/init.ps1"
#tool "dotnet:?package=GitVersion.Tool&version=5.12.0"
#tool "dotnet:?package=JetBrains.dotCover.GlobalTool&version=2023.2.0"
#tool "dotnet:?package=JetBrains.ReSharper.GlobalTools&version=2023.2.0"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants