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

'iOS" is a namespace but is used like a type error when adding the NewRelic nuget #45

Closed
robin-schroeder-merc opened this issue Sep 12, 2024 · 5 comments
Labels
bug Something isn't working

Comments

@robin-schroeder-merc
Copy link

robin-schroeder-merc commented Sep 12, 2024

After I add the NewRelic.MAUI.Plugin to my .Net MAUI solution, I get compiler errors. I was also able to reproduce this with a brand new .Net MAUI sln. If I remove the NewRelic.MAUI.Plugin nuget package, the following compiler errors disappear.

Description

Steps to Reproduce

  1. Create a brand new .Net MAUI Application with .Net 8.
  2. Notice you can compile successfully.
  3. Open your AppShell.xaml.cs and add the following after the InitializeComponent();
    var safeInsets = On().SafeAreaInsets();
  4. Notice you can compile successfully.
  5. Add Nuget package NewRelic.MAUI.Plugin
  6. Notice that you cannot compile anymore. The errors are as follows:
  • Error (active) CS0118 'iOS' is a namespace but is used like a type MauiApp3 (net8.0-ios) C:\Code\MauiApp3\MauiApp3\AppShell.xaml.cs 12
  • Error (active) CS1929 'IPlatformElementConfiguration<iOS, Page>' does not contain a definition for 'SafeAreaInsets' and the best extension method overload 'Page.SafeAreaInsets(IPlatformElementConfiguration<iOS, Page>)' requires a receiver of type 'Microsoft.Maui.Controls.IPlatformElementConfiguration<Microsoft.Maui.Controls.PlatformConfiguration.iOS, Microsoft.Maui.Controls.Page>' MauiApp3 (net8.0-ios) C:\Code\MauiApp3\MauiApp3\AppShell.xaml.cs 12

Expected Behavior

I would expect it to compile successfully.

Relevant Logs / Console output

Your Environment

Visual Studio (PC) Version 17.11.0

Additional context

You can read more about the Safe Insets feature in MAUI here: https://learn.microsoft.com/en-us/dotnet/maui/ios/platform-specifics/page-safe-area-layout?view=net-maui-8.0

@robin-schroeder-merc robin-schroeder-merc added the bug Something isn't working label Sep 12, 2024
@robin-schroeder-merc
Copy link
Author

image

@ndesai-newrelic
Copy link
Contributor

@robin-schroeder-merc i will look into it.

@ndesai-newrelic
Copy link
Contributor

@robin-schroeder-merc we created internal ticket for this, it will fix in next maui agent release.

ndesai-newrelic added a commit that referenced this issue Sep 23, 2024
@ndesai-newrelic
Copy link
Contributor

@robin-schroeder-merc the issue is fixed in 1.1.2 release.

@robin-schroeder-merc
Copy link
Author

Thank you! It works!

ndesai-newrelic added a commit that referenced this issue Sep 27, 2024
* fix:iOS namespace issue #45

* fix: added missing info.plist file in iOS bindings
ndesai-newrelic added a commit that referenced this issue Oct 22, 2024
* fix:iOS namespace issue #45

* fix: added missing info.plist file in iOS bindings

* release 1.1.4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants