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

Could not get pinvoke, or callbacks for method 'Sentry.Native.C::sentry_options_set_logger' #3369

Open
klemmchr opened this issue May 14, 2024 · 2 comments
Labels
Blazor Bug Something isn't working Good First Issue Good for newcomers

Comments

@klemmchr
Copy link

Package

Sentry

.NET Flavor

.NET

.NET Version

8.0.5

OS

Any (not platform specific)

SDK Version

4.6.2

Self-Hosted Sentry Version

No response

Steps to Reproduce

  1. Compile a Blazor project with AoT enabled (Repro from Sentry fails to initialize in Blazor with AoT enabled #3263 should work)
  2. Observe warning in build

Expected Result

No warning

Actual Result

During AoT the following warning is emitted

[WRN] /usr/share/dotnet/packs/Microsoft.NET.Runtime.WebAssembly.Sdk/8.0.5/Sdk/WasmApp.Native.targets(338,5): warning WASM0001: Could not get pinvoke, or callbacks for method 'Sentry.Native.C::sentry_options_set_logger' because 'Parsing function pointer types in signatures is not supported.' [/builds/acodia-care/acodia-care/src/Web/Web.Blazor/Web.Blazor.csproj]

The app itself works fine, I don't observe any errors in console or during build.

@bitsandfoxes
Copy link
Contributor

@vaind do you think we can disable the warning now that we're guarding and not initializing sentry-native on Blazor? It does sound like a potential foot gun down the road tho.

@vaind
Copy link
Collaborator

vaind commented May 15, 2024

I don't think we can do anything else than disable the warning. There's only a runtime check for us to use: dotnet/aspnetcore#38667 (comment) thus we cannot get rid of the warning by not including the code at all.

@bitsandfoxes bitsandfoxes added Bug Something isn't working Good First Issue Good for newcomers Blazor labels May 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Blazor Bug Something isn't working Good First Issue Good for newcomers
Projects
Status: No status
Status: No status
Development

No branches or pull requests

3 participants