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

[Bug]: Error (active) CS1061 "IServiceCollection" does not contain a definition for "AddNotifications" #1568

Closed
7 of 12 tasks
Bricobit opened this issue Feb 20, 2025 · 1 comment
Labels
bug Something isn't working unverified This issue has not been verified by a maintainer

Comments

@Bricobit
Copy link

Bricobit commented Feb 20, 2025

Component/Nuget

Notifications (Shiny.Notifications)

What operating system(s) are effected?

  • iOS (13+ supported)
  • Mac Catalyst
  • Android (10+ supported)

Version(s) of Operation Systems

Hosting Model

  • MAUI
  • Native/Classic Xamarin
  • Manual

Steps To Reproduce

using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Shiny;
using Shiny.Notifications;

namespace App {
    public static class MauiProgram {
        public static MauiApp CreateMauiApp() {
            var builder = MauiApp
         .CreateBuilder()
         .UseMauiApp<App>()
         .UseShiny() // <-- add this line (this is important)
         .ConfigureFonts(fonts => {
             fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
             fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold");
         });
           builder.Services.AddNotifications();
#if DEBUG
            builder.Logging.AddDebug();
#endif
            return builder.Build();
        }
    }
}

Expected Behavior

No error

Actual Behavior

Error in AddNotifications line
builder.Services.AddNotifications();

Exception or Log output

Error (active) CS1061 "IServiceCollection" does not contain a definition for "AddNotifications" or an accessible extension method "AddNotifications" that accepts a first argument of type "IServiceCollection" (are you missing a using directive or an assembly reference?) App (net9.0-windows10.0.19041.0) C:

Reproducible Code Sample (should be Small, Shiny specific, Compile & Run)

error in builder.Services.AddNotifications();

Code of Conduct

  • I have supplied a reproducible sample that is small, shows the specific issue, compiles, runs, and is NOT FROM THE SHINY SAMPLES!
  • I am using the LATEST STABLE version from nuget (v3.3.4)
  • I am Sponsor OR My GitHub account is 30+ days old
  • I acknowledge that this is not technical support and that the maintainer(s) are not here as teachers or to diagnose logs
  • I understand that this is not a paid product, it is FREE code that I am using, and that documentation may not be perfect.
  • I acknowledge that any form of swearing or general abuse towards the maintainer(s) will result in my immediate ban.
@Bricobit Bricobit added bug Something isn't working unverified This issue has not been verified by a maintainer labels Feb 20, 2025
@aritchie
Copy link
Member

Shiny doesn't support Windows. You need to remove windows as a target or use #if !WINDOWS around any shiny calls

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working unverified This issue has not been verified by a maintainer
Projects
None yet
Development

No branches or pull requests

2 participants