Error: Cannot provide a value for property 'NotificationService' on type 'AntDesign.Notification'
See original GitHub issueI 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:
- Created 3 years ago
- Comments:5 (5 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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.Thank you for your advice @ajitgoel . You also can help us to improve the document and PR is always welcome.