YAFLogo

AMtoUseYAF
  • AMtoUseYAF
  • 58% (Neutral)
  • YAF Forumling Topic Starter YAF Version: 4.0.0
a month ago
Everyone could recreate the problem when using ‘YAF.NET v4.0.0 SampleApp’

 You can call ‘Login’ directly from home by direct link /Forums/Account/Login.

But when you go in /Forums and try to use ‘Login’ link you get the following error:

“Autofac.Core.Registration.ComponentNotRegisteredException: 'The requested service 'YAF.Core.Services.LinkBuilder' 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.”

 

Depending on which page you click on the ‘Login’ link you get the error either in

_LoginBox.cshtml

 250510-ErrorLogin-LoginBox.PNG You have insufficient rights to see the content.

or in

AutoFacServiceLocatorProvider.cs file.

 250510-ErrorLogin-AutoFac.PNG You have insufficient rights to see the content.

 

What would be the best way to resolve this issue?

Shall we expect the similar behaviour caused by 'YAF.Core.Services.LinkBuilder' for any other link, when we set the forums RazorPages in ‘Areas’?

Sponsor
tha_watcha
  • tha_watcha
  • 100% (Exalted)
  • YAF.NET Project Lead 🤴 YAF Version: 4.0.1 BETA
a month ago
Looks like i committed the fix after the release of the yaf sample app 4.0.0. You only need to replace the LinkBuilder with the interface ILinkBuilder 

https://github.com/YAFNET/YAF.SampleWebApplication/commit/79466d46163d1bd6410b5e1399856f7b496988ad 

AMtoUseYAF
  • AMtoUseYAF
  • 58% (Neutral)
  • YAF Forumling Topic Starter YAF Version: 4.0.0
a month ago
Thank you, @the_watcha! It fixed the issue.