Are mixed-mode assemblies (C ++ / CLI projects) assembled on .NET Core?

I have a code base that uses a C ++ / CLI project that provides C ++ classes for the CLR through thin shell classes. For instance...

C ++ - code in a C ++ project

class Foo { public Foo(bool wat) { /* do the things */ } }; 

C ++ / CLI code in a mixed-mode assembly (C ++ / CLI project)

 public ref class ManagedFoo { Foo * foo; public: ManagedFoo (bool wat) { foo = new Foo(wat); } !ManagedFoo () { delete foo; } ~ManagedFoo () { this->!ManagedFoo (); } }; 

As far as I know, assemblies in mixed mode will largely only run on Windows.NET. I hope that I don’t need to rebuild the components and use P/Invoke , which will give me cross-platform support.

Does anyone know if .NET Core supports mixed builds? Other ideas are welcome.

+6
source share
1 answer

Unmanaged code in the context of C ++ / CLI is always platform dependent and compiled for a specific OS (Windows) and specific processor architecture (x86 / x64). Unmanaged code in C ++ / CLI turns out to be very similar to actual C ++ code compiled using the C ++ compiler. Since mixed-mode assemblies may contain native code, they are tied to a specific OS and CPU architecture.

+4
source

Source: https://habr.com/ru/post/984910/


All Articles