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 RyuJIT - linked native resource problem #6375

@tokaplan

Description

@tokaplan

Following these instructions, I'm trying to generate a native executable from my .NET Core assembly which has a dependency on Grpc.Core nuget. I hit the following issue:

dotnet publish -r win-x64

Microsoft.LocalForwarder.ConsoleHost.obj : error LNK2001: unresolved external symbol grpcsharp_auth_context_property_iterator [D:\Git\ApplicationInsights-LocalForwarder\src\ConsoleHost\ConsoleHost.csproj]
... same error message for every exported function from grpc_csharp_ext.x64.dll (see below)

Turns out Grpc.Core's assembly uses a native DLL called grpc_csharp_ext.x64.dll. They invoke it via DllImport, but there's also some sort of static dependency in the metadata. This is how ILSpy shows it:

image

I've never seen this, but I'm guessing this is the sort of reference that -linkresource option creates as described here.

Regardless, the question is - what's the best course of action here? Should I be able to compile such assembly into native code? How do I proceed to fix this?

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