mono / Embeddinator-4000

Tools to turn .NET libraries into native libraries that can be consumed on Android, iOS, Mac, Linux and other platforms.
MIT License
758 stars 95 forks source link

Compile error when referencing third party libraries via nuget #752

Closed ezraShenglei closed 4 years ago

ezraShenglei commented 4 years ago

Steps to Reproduce

  1. When I introduced this SpreadsheetGear library in nuget and called the relevant methods of the SpreadsheetGear library in my MyView.
  2. objcgen /Users/wushenglei/Projects/hello-from-csharp/hello-from-csharp/bin/Debug/hello_from_csharp.dll --target=framework --platform=iOS --outdir=output -c --debug

Expected Behavior

Generate the corresponding .framework file

Actual Behavior

Error log

Environment

OSX 10.14.6 embeddinator-4000 0.40 Visual Studio for Mac 8.4 build 2653 SpreadsheetGear 8.3.25.102

Build Logs

using framework: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.2.sdk warning MT0136: Cannot find the assembly 'SpreadsheetGear, Version=8.3.25.102, Culture=neutral, PublicKeyToken=39c186f5904944ec' referenced from '/Users/wushenglei/Projects/hello-from-csharp/hello-from-csharp/bin/Debug/hello_from_csharp.dll'. warning MT0136: Cannot find the assembly 'SpreadsheetGear, Version=8.3.25.102, Culture=neutral, PublicKeyToken=39c186f5904944ec' referenced from '/Users/wushenglei/Projects/hello-from-csharp/hello-from-csharp/bin/Debug/hello_from_csharp.dll'. error MT2002: Failed to resolve assembly: 'SpreadsheetGear, Version=8.3.25.102, Culture=neutral, PublicKeyToken=39c186f5904944ec'

Example Project (If Possible)

hello-from-csharp.zip

Switch to the "Preview" tab to ensure your issue renders correctly. -->

chamons commented 4 years ago

So the problem is that in the bin folder:

ls  /Users/donblas/Downloads/hello-from-csharp/hello-from-csharp/bin/Debug/
hello_from_csharp.dll hello_from_csharp.pdb

we don't see that DLL, so it can't be processed.

In c# library projects don't copy their dependencies next to the output.

If I manually copy the dependency next to it:

 $ cp ~/.nuget/packages/spreadsheetgear/8.3.25/lib/netstandard1.3/SpreadsheetGear.dll /Users/donblas/Downloads/hello-from-csharp/hello-from-csharp/bin/Debug/

Then the build completes for me.