Skip to content
This repository has been archived by the owner on Oct 25, 2021. It is now read-only.

objcgen does not support netcore assemblies by default #777

Open
delebedev opened this issue Jun 30, 2020 · 3 comments
Open

objcgen does not support netcore assemblies by default #777

delebedev opened this issue Jun 30, 2020 · 3 comments

Comments

@delebedev
Copy link

Steps to Reproduce

I've created vanilla netcore app with "hello world" class, built it with Visual Studio and trying to use objcgen from terminal:

~/.nuget/packages/embeddinator-4000/0.4.0/tools/objcgen net-embedding/bin/Debug/netcoreapp3.1/net-embedding.dll --out=out --platform=macOS-modern --abi=x86_64 --nativeexception --compile --debug --target=framework
Symbol file /Users/denis.lebedev/.nuget/packages/embeddinator-4000/0.4.0/tools/IKVM.Reflection.pdb doesn't match image /Users/denis.lebedev/.nuget/packages/embeddinator-4000/0.4.0/tools/IKVM.Reflection.dll
Parsing assemblies...
	Parsed 'net-embedding/bin/Release/netcoreapp3.1/net-embedding.dll'
Processing assemblies...
error EM0013: Can't find the assembly 'System.Runtime, Version=4.2.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a', referenced by 'net-embedding, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'.
Debug Log:
Processing: 1 assemblies
Processing Assembly: net-embedding

Expected Behavior

Framework is built

Actual Behavior

No framework

Environment

macos 10.15.5
Visual Studio 8.6.5
objcgen 0.4.0

@delebedev delebedev changed the title EM0013: Can't find the assembly 'System.Runtime EM0013: Can't find the assembly 'System.Runtime' Jun 30, 2020
@chamons
Copy link
Contributor

chamons commented Jun 30, 2020

So netcoreapp3.1 suggests this is a .net core application, and I suspect that Embeddinator is not pulling in the various netcore facades and dependencies.

You may be able to hack around this by passing the other assemblies to objcgen in the same invocation, but this is a limitation (we don't support netcore directly yet).

@chamons chamons added this to the Future milestone Jun 30, 2020
@chamons chamons changed the title EM0013: Can't find the assembly 'System.Runtime' objcgen does not support netcore assemblies by default Jun 30, 2020
@delebedev
Copy link
Author

delebedev commented Jun 30, 2020

@chamons I actually tried it with netstandard2.1 too, got

error EM0013: Can't find the assembly 'netstandard, Version=2.1.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51', referenced by 'embeddinator-test, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'.

You may be able to hack around this by passing the other assemblies to objcgen in the same invocation

Would greatly appreciate an example command to to do so

@christosk92
Copy link

@delebedev I had a similar issue where it couldn't find newtonsoft.json
I fixed this by adding:

<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies> to my csproj file and then rebuilding!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants