Could not get pinvoke, or callbacks for method 'Sentry.Native.C::sentry_options_set_logger'
klemmchr opened this issue · 2 comments
klemmchr commented
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
- Compile a Blazor project with AoT enabled (Repro from #3263 should work)
- 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 commented
@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 commented
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.