How to include grpc_csharp_ext.x86.dll with Fody/Costura?

Viewed 470

Looking forward to this article and issue:

1) https://idmedia.no/general/including-sqlite-interop-dll-into-your-c-project/

2) https://github.com/Fody/Fody/issues/673

Could not resolve an issue. Did anyone have a similar issue?

Costura/Fody can not include grpc_csharp_ext.x86.dll. Does it matter because it is runtime .dll? Ignore this message check internet connection it is just my suffix sentence to almost every error message.

Image 1) Ignore this message check internet connection it is just my suffix sentence. .

.

.

.

That is .dll that is not included.

Image 2) That is .dll that is not included. .

.

.

.

And those are dlls in solution project like on link 1) Set to EmbededResource but still not working.

Image 3) And those are dlls in solution project like on link 1) Set to EmbededResource but still not working. .

.

.

.

And this is my FodyWeavers.xml

<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
         xsi:noNamespaceSchemaLocation="FodyWeavers.xsd">
  <Costura IgnoreSatelliteAssemblies='true'
           Unmanaged32Assemblies='grpc_csharp_ext'
           Unmanaged64Assemblies='grpc_csharp_ext'>
  </Costura>
</Weavers>
2 Answers

I had the same problem when building my .NET app which used gRPC. I found out that if I didn't include the global.json file in the root of the repository and explicitly stated the SDK version which I want to use, the build would just use the default SDK version which, for some reason, didn't include the grpc_csharp_ext.x86.dll in the output folder.

I would suggest to include the file in your solution and then try to build it.

Example global.json file:

{
  "sdk": {
    "version": "2.2.207"
  }
}

If you don't want this file, you can also create a powershell script which creates the file, builds (or publishes) the solution and then removes the file:

dotnet new globaljson --sdk-version 2.2.207
try
{
    dotnet build ... (or dotnet publish ...)
}
finally
{
    Remove-Item .\global.json
}
Related