Skip to content
This repository was archived by the owner on Nov 1, 2020. It is now read-only.
This repository was archived by the owner on Nov 1, 2020. It is now read-only.

Generating native code with Grpc.Core #8360

Open

Description

@DenMpei

Good day!

I hit the following issue:
dotnet publish -r win-x64 leads to numerous compilation errors

image

Inside the package is used Grpc.Core 2.28.1

image

Сompile with Microsoft.DotNet.ILCompiler 1.0.0-alpha-29408-02

Adding code from this issue doesn't help

I ask to give advice to solve the problem.
Regards.

Activity

  1. MichalStrehovsky commented on Oct 9, 2020

    @MichalStrehovsky
    Member

    Adding code from this issue doesn't help

    The attribute got renamed to UnmanagedCallersOnly. Try this definition:

    [AttributeUsage(AttributeTargets.Method)]
    public sealed class UnmanagedCallersOnlyAttribute : Attribute
    {
    public string EntryPoint;
    public CallingConvention CallingConvention;
    public UnmanagedCallersOnlyAttribute() { }
    }

  2. DenMpei commented on Oct 12, 2020

    @DenMpei
    Author

    Didn't work :( I will try to provide a minimal version of the project. But it won't be soon, because reference on Grpc.Core is very deep in real project. :(

  3. MichalStrehovsky commented on Oct 12, 2020

    @MichalStrehovsky
    Member

    Didn't work :( I will try to provide a minimal version of the project. But it won't be soon, because reference on Grpc.Core is very deep in real project. :(

    Make sure you put the UnmanagedCallersOnlyAttribute-annotated method in the entrypoint assembly (whatever assembly is the main executable). The compiler doesn't look elsewhere.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions