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

Error: The requested service 'Cake.Commands.DefaultCommandSettings' has not been registered #3697

Closed
2 tasks done
augustoproiete opened this issue Nov 14, 2021 · 1 comment · Fixed by #3698
Closed
2 tasks done
Assignees
Labels
Milestone

Comments

@augustoproiete
Copy link
Member

Prerequisites

  • I have written a descriptive issue title
  • I have searched issues to ensure it has not already been reported

Cake runner

Cake .NET Tool

Cake version

2.0.0-rc0001

Operating system

N/A

Operating system architecture

N/A

CI Server

N/A

What are you seeing?

When attempting to F5/Debug the Cake project on Visual Studio 2022 (also on 2019), we get the error below:


Autofac.Core.Registration.ComponentNotRegisteredException
  HResult=0x80131500
  Message=The requested service 'Cake.Commands.DefaultCommandSettings' has not been registered. To avoid this exception, either register a component to provide the service, check for service registration using IsRegistered(), or use the ResolveOptional() method to resolve an optional dependency.
  Source=Autofac
  StackTrace:
   at Autofac.ResolutionExtensions.ResolveService(IComponentContext context, Service service, IEnumerable`1 parameters)
   at Autofac.ResolutionExtensions.Resolve(IComponentContext context, Type serviceType, IEnumerable`1 parameters)
   at Autofac.ResolutionExtensions.Resolve(IComponentContext context, Type serviceType)
   at Cake.Infrastructure.Composition.AutofacTypeResolver.Resolve(Type type) in C:\...\cake\src\Cake\Infrastructure\Composition\AutofacTypeResolver.cs:line 22
   at Spectre.Console.Cli.TypeResolverAdapter.Resolve(Type type) in /_/src/Spectre.Console/Cli/Internal/TypeResolverAdapter.cs:line 25

image

What is expected?

No exception thrown / Autofac should be able to resolve DefaultCommandSettings

Steps to Reproduce

  • Open the Cake solution
  • Debug the execution of an existing .cake file

Output log

No response

@cake-build-bot
Copy link

🎉 This issue has been resolved in version v2.0.0 🎉

The release is available on:

Your GitReleaseManager bot 📦🚀

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

Successfully merging a pull request may close this issue.

2 participants