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

Fix trimming warnings in Microsoft.Data.Sqlite #30728

Merged
merged 1 commit into from
Apr 19, 2023
Merged

Commits on Apr 18, 2023

  1. Fix trimming warnings in Microsoft.Data.Sqlite

    Fixes #29725
    
    There were two types of issue:
    
    - In SqliteConnection, the linker was unable to determine the type returned by the `GetType` call. Fixed by explicitly specifying the type.
    - In SqliteDataReader, `GetFieldType` on the base has been annotated with `DynamicallyAccessedMembers`, which needed to be flowed through to called methods.
    
    Tested with code from [Nanorm](https://github.com/DamianEdwards/Nanorm/tree/main/samples/Nanorm.Samples.Console.Todos.Sqlite)
    
    After fixes:
    
    ```
    PS C:\local\code\TrimTest\TrimTest> dotnet publish -f net8.0 -r win10-x64 --self-contained -v m --nologo -o pub
      Determining projects to restore...
      Restored C:\local\code\TrimTest\TrimTest\TrimTest.csproj (in 283 ms).
      Restored C:\local\code\TrimTest\Nanorm.Sqlite\Nanorm.Sqlite.csproj (in 283 ms).
      Restored C:\local\code\TrimTest\Nanorm\Nanorm.csproj (in 283 ms).
    C:\Program Files\dotnet\sdk\8.0.100-preview.3.23178.7\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.RuntimeIdentifierInference.targets(287,5): message NETSDK1057: You are using a preview version of .NET. See: https://aka.ms/dotnet-support-policy [C:\local\code\TrimTest\TrimTest\TrimTest.csproj]
      Nanorm -> C:\local\code\TrimTest\Nanorm\bin\Release\net8.0\Nanorm.dll
      Nanorm.Sqlite -> C:\local\code\TrimTest\Nanorm.Sqlite\bin\Release\net8.0\Nanorm.Sqlite.dll
      TrimTest -> C:\local\code\TrimTest\TrimTest\bin\Release\net8.0\win10-x64\TrimTest.dll
      Generating native code
      TrimTest -> C:\local\code\TrimTest\TrimTest\pub\
    ```
    ajcvickers committed Apr 18, 2023
    Configuration menu
    Copy the full SHA
    28d30af View commit details
    Browse the repository at this point in the history