question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error: Cannot provide a value for property 'NotificationService' on type 'AntDesign.Notification'

See original GitHub issue

I am following the instructions provided in “Import Ant Design Blazor into an existing project” at https://github.com/ant-design-blazor/ant-design-blazor. When I run the application, I get the following error

blazor.webassembly.js:1 crit: Microsoft.AspNetCore.Components.WebAssembly.Rendering.WebAssemblyRenderer[100]
      Unhandled exception rendering component: Cannot provide a value for property 'NotificationService' on type 'AntDesign.Notification'. There is no registered service of type 'AntDesign.NotificationService'.
System.InvalidOperationException: Cannot provide a value for property 'NotificationService' on type 'AntDesign.Notification'. There is no registered service of type 'AntDesign.NotificationService'.

Based on the information provided here, I need to define the “Register the services” in the program.cs instead of the startup.cs. Can you please advise?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
ajitgoelcommented, Oct 23, 2020

I was able to get this working by installing the library in the client project and adding the line builder.Services.AddAntDesign(); in the client project. I am assuming that the getting started portion of the ant-design-blazor needs to be updated.

0reactions
ElderJamescommented, Oct 23, 2020

Thank you for your advice @ajitgoel . You also can help us to improve the document and PR is always welcome.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Ant Design Blazor Show message Callback not working
I am trying to get a message to show up using the a card with actions from Ant Design Blazor; however, for some...
Read more >
Notification
A notification providing a feedback based on the user interaction. Or it may show some details about upcoming steps the user may have...
Read more >
Cannot provide a value for property 'Service'
When I add the <RadzenDialog /> to MainLayout, I get the following error on trying to load: InvalidOperationException: Cannot provide a value ...
Read more >
Solution For Blazor Error - Cannot provide a value for property ...
While experimenting with Blazor, I ran into "There is no registered service of type [TypeName]" error. I was trying to use a new...
Read more >
使用Ant Design of Blazor遇到的一个问题原创
InvalidOperationException : Cannot provide a value for property 'NotificationService' on type 'AntDesign.Notification'.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found