2

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>
I.Step
  • 613
  • 6
  • 22
  • Did you tried to decompile final dll to see if dll is actually missing? Seems like linkage error. – eocron Apr 06 '20 at 22:40
  • Yes I decompiled, but another dll **Grpc.Core.dll** in my project needs that specific dll, and yes after decompile there is no grpc_csharp_ext.dll in final .exe. Any more suggestions. I already tried to add **grpc_csharp_ext.dll** as a reference to a project but I gives me error: Could not be added. Please make sure that the file is accessible, and that it is a valid assembly or COM component. – I.Step Apr 07 '20 at 09:46

2 Answers2

0

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
}
Ivan Ivković
  • 417
  • 3
  • 14
  • Thank you for your answer, I used ClickOnce with installer approach, instead of Costura/Fody, but if I will ever use Costura/Fody I will try this. – I.Step Apr 29 '20 at 10:15
0

The problem is - Grpc.Core is internally searching for grpc_csharp_ext dlls in the App folder:

https://github.com/grpc/grpc/blob/e5562a66a4e6bd1900bc9b144587d6d593720c1d/src/csharp/Grpc.Core/Internal/NativeExtension.cs#L91

The workaround to put it into the Costura package is described in:

https://www.giters.com/Fody/Costura/issues/641

The main idea is to extract these dlls from the Costura package on app start.